diff --git a/.gitignore b/.gitignore index 109af38..79cdd3f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,14 @@ +#Project sources +java8-jersey2/src/main +java8-okhttp-gson/src/main +java8-retrofit2/src/main +csharp-net35/src/Sphereon.SDK.TemplateProcessor +csharp-net45/src/Sphereon.SDK.TemplateProcessor +javascript/src +html-docs/index.html +node_modules/ +docs/ + # Visual Studio .vs/ bin/ @@ -26,7 +37,7 @@ log.* #Intellij *.iml -.idea +.idea/ #Maven target/ @@ -40,3 +51,4 @@ buildNumber.properties .mvn/timing.properties applog* + diff --git a/buildAllMavenProfiles.cmd b/buildAllMavenProfiles.cmd index a1087d1..f903fa9 100644 --- a/buildAllMavenProfiles.cmd +++ b/buildAllMavenProfiles.cmd @@ -1,2 +1,7 @@ -call mvn -Pjava8 clean install -call mvn -Pcsharp-net45 clean install \ No newline at end of file +call mvn -Pjava8-jersey2 clean install +start mvn -Pjava8-okhttp-gson clean install +start mvn -Pjava8-retrofit2 clean install +start mvn -Pcsharp-net45 clean install +start mvn -Pcsharp-net35 clean install +start mvn -Pjavascript clean install +start mvn -Phtml-docs clean install diff --git a/buildAllMavenProfiles.sh b/buildAllMavenProfiles.sh new file mode 100755 index 0000000..e6e0871 --- /dev/null +++ b/buildAllMavenProfiles.sh @@ -0,0 +1,8 @@ +#!/bin/sh +mvn -Pjava8-jersey2 clean install +mvn -Pjava8-okhttp-gson clean install +mvn -Pjava8-retrofit2 clean install +mvn -Pcsharp-net45 clean install +mvn -Pcsharp-net35 clean install +mvn -Pjavascript clean install +mvn -Phtml-docs clean install \ No newline at end of file diff --git a/csharp-net35/.gitignore b/csharp-net35/.gitignore new file mode 100644 index 0000000..17302c9 --- /dev/null +++ b/csharp-net35/.gitignore @@ -0,0 +1,186 @@ +# Ref: https://gist.github.com/kmorcinek/2710267 +# Download this file using PowerShell v3 under Windows with the following comand +# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore + +# User-specific files +*.suo +*.user +*.sln.docstates +./nuget + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# OS generated files # +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings +modulesbin/ +tempbin/ + +# EPiServer Site file (VPP) +AppData/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# vim +*.txt~ +*.swp +*.swo + +# svn +.svn + +# SQL Server files +**/App_Data/*.mdf +**/App_Data/*.ldf +**/App_Data/*.sdf + + +#LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store + +# SASS Compiler cache +.sass-cache + +# Visual Studio 2014 CTP +**/*.sln.ide diff --git a/java8/.swagger-codegen-ignore b/csharp-net35/.swagger-codegen-ignore similarity index 100% rename from java8/.swagger-codegen-ignore rename to csharp-net35/.swagger-codegen-ignore diff --git a/csharp-net35/.swagger-codegen/VERSION b/csharp-net35/.swagger-codegen/VERSION new file mode 100644 index 0000000..a625450 --- /dev/null +++ b/csharp-net35/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/csharp-net35/.travis.yml b/csharp-net35/.travis.yml new file mode 100644 index 0000000..e6b6dff --- /dev/null +++ b/csharp-net35/.travis.yml @@ -0,0 +1,9 @@ +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# +language: csharp +mono: + - latest +solution: Sphereon.SDK.TemplateProcessor.sln +script: + - /bin/sh ./mono_nunit_test.sh diff --git a/csharp-net35/README.md b/csharp-net35/README.md new file mode 100644 index 0000000..a0e9c09 --- /dev/null +++ b/csharp-net35/README.md @@ -0,0 +1,162 @@ +# Sphereon.SDK.TemplateProcessor - the C# library for the Template-Processor + +The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + +This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 0.1 +- SDK version: 0.1.1 +- Build package: io.swagger.codegen.languages.CSharpClientCodegen + For more information, please visit [https://sphereon.com](https://sphereon.com) + + +## Frameworks supported +- .NET 4.0 or later +- Windows Phone 7.1 (Mango) + + +## Dependencies +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.2.0 or later + +The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +Install-Package RestSharp +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +``` + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742) + + +## Installation +Run the following command to generate the DLL +- [Mac/Linux] `/bin/sh build.sh` +- [Windows] `build.bat` + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Model; +``` + +## Packaging + +A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. + +This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: + +``` +nuget pack -Build -OutputDirectory out Sphereon.SDK.TemplateProcessor.csproj +``` + +Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. + + +## Getting Started + +```csharp +using System; +using System.Diagnostics; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Model; + +namespace Example +{ + public class Example + { + public void main() + { + + // Configure OAuth2 access token for authorization: oauth2schema + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new AllApi(); + var payload = payload_example; // string | The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] + + try + { + // Store dataset + DataSetResponse result = apiInstance.CreateDataSet(payload); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling AllApi.CreateDataSet: " + e.Message ); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *https://gw.api.cloud.sphereon.com/template/processor/0.1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AllApi* | [**CreateDataSet**](docs/AllApi.md#createdataset) | **POST** /datasets | Store dataset +*AllApi* | [**CreateTemplateContext**](docs/AllApi.md#createtemplatecontext) | **POST** /templates | Create template context +*AllApi* | [**DeleteDataSet**](docs/AllApi.md#deletedataset) | **DELETE** /datasets/{dataSetId} | Delete a stored data set +*AllApi* | [**DeleteJob**](docs/AllApi.md#deletejob) | **DELETE** /jobs/{jobId} | Delete a job manually +*AllApi* | [**DeleteTemplateContext**](docs/AllApi.md#deletetemplatecontext) | **DELETE** /templates/{templateId} | Delete template context +*AllApi* | [**GetJob**](docs/AllApi.md#getjob) | **GET** /jobs/{jobId} | Job definition and state +*AllApi* | [**GetJobs**](docs/AllApi.md#getjobs) | **GET** /jobs | Get all jobs +*AllApi* | [**GetResultStream**](docs/AllApi.md#getresultstream) | **PUT** /jobs/{jobId}/result/stream | Get the result file +*AllApi* | [**GetResultStreamsAsContainer**](docs/AllApi.md#getresultstreamsascontainer) | **PUT** /jobs/{jobId}/result/container | Get the result file +*AllApi* | [**GetTemplateContext**](docs/AllApi.md#gettemplatecontext) | **GET** /templates/{templateId} | Get template context +*AllApi* | [**SubmitJob**](docs/AllApi.md#submitjob) | **PUT** /jobs | Submit merge job for processing +*AllApi* | [**UpdateTemplateContext**](docs/AllApi.md#updatetemplatecontext) | **PUT** /templates | Update template context +*AllApi* | [**UploadTemplateFile**](docs/AllApi.md#uploadtemplatefile) | **POST** /templates/{templateId} | Upload template file +*DataSetApi* | [**CreateDataSet**](docs/DataSetApi.md#createdataset) | **POST** /datasets | Store dataset +*DataSetApi* | [**DeleteDataSet**](docs/DataSetApi.md#deletedataset) | **DELETE** /datasets/{dataSetId} | Delete a stored data set +*JobApi* | [**GetJob**](docs/JobApi.md#getjob) | **GET** /jobs/{jobId} | Job definition and state +*JobApi* | [**GetJobs**](docs/JobApi.md#getjobs) | **GET** /jobs | Get all jobs +*JobApi* | [**GetResultStream**](docs/JobApi.md#getresultstream) | **PUT** /jobs/{jobId}/result/stream | Get the result file +*JobApi* | [**GetResultStreamsAsContainer**](docs/JobApi.md#getresultstreamsascontainer) | **PUT** /jobs/{jobId}/result/container | Get the result file +*JobApi* | [**SubmitJob**](docs/JobApi.md#submitjob) | **PUT** /jobs | Submit merge job for processing +*TemplateApi* | [**CreateTemplateContext**](docs/TemplateApi.md#createtemplatecontext) | **POST** /templates | Create template context +*TemplateApi* | [**DeleteTemplateContext**](docs/TemplateApi.md#deletetemplatecontext) | **DELETE** /templates/{templateId} | Delete template context +*TemplateApi* | [**GetTemplateContext**](docs/TemplateApi.md#gettemplatecontext) | **GET** /templates/{templateId} | Get template context +*TemplateApi* | [**UpdateTemplateContext**](docs/TemplateApi.md#updatetemplatecontext) | **PUT** /templates | Update template context +*TemplateApi* | [**UploadTemplateFile**](docs/TemplateApi.md#uploadtemplatefile) | **POST** /templates/{templateId} | Upload template file + + + +## Documentation for Models + + - [Model.ClaimParameters](docs/ClaimParameters.md) + - [Model.DataSetResponse](docs/DataSetResponse.md) + - [Model.Error](docs/Error.md) + - [Model.ErrorResponse](docs/ErrorResponse.md) + - [Model.Lifecycle](docs/Lifecycle.md) + - [Model.MergeJob](docs/MergeJob.md) + - [Model.MergeJobResponse](docs/MergeJobResponse.md) + - [Model.MergeSettings](docs/MergeSettings.md) + - [Model.OutputSettings](docs/OutputSettings.md) + - [Model.OwnerInfo](docs/OwnerInfo.md) + - [Model.ResultStreamRequest](docs/ResultStreamRequest.md) + - [Model.StorageLocation](docs/StorageLocation.md) + - [Model.StreamLocation](docs/StreamLocation.md) + - [Model.TemplateContext](docs/TemplateContext.md) + - [Model.TemplateContextRequest](docs/TemplateContextRequest.md) + - [Model.TemplateContextResponse](docs/TemplateContextResponse.md) + + + +## Documentation for Authorization + + +### oauth2schema + +- **Type**: OAuth +- **Flow**: application +- **Authorization URL**: +- **Scopes**: + - global: accessEverything + diff --git a/csharp-net35/Sphereon.SDK.TemplateProcessor.sln b/csharp-net35/Sphereon.SDK.TemplateProcessor.sln new file mode 100644 index 0000000..701b138 --- /dev/null +++ b/csharp-net35/Sphereon.SDK.TemplateProcessor.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sphereon.SDK.TemplateProcessor", "src\Sphereon.SDK.TemplateProcessor\Sphereon.SDK.TemplateProcessor.csproj", "{D69606FB-2A3F-4363-A33C-4FAD5967BB66}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sphereon.SDK.TemplateProcessor.Test", "src\Sphereon.SDK.TemplateProcessor.Test\Sphereon.SDK.TemplateProcessor.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D69606FB-2A3F-4363-A33C-4FAD5967BB66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D69606FB-2A3F-4363-A33C-4FAD5967BB66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D69606FB-2A3F-4363-A33C-4FAD5967BB66}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D69606FB-2A3F-4363-A33C-4FAD5967BB66}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/csharp-net35/build.bat b/csharp-net35/build.bat new file mode 100644 index 0000000..07fccca --- /dev/null +++ b/csharp-net35/build.bat @@ -0,0 +1,17 @@ +:: Generated by: https://github.com/swagger-api/swagger-codegen.git +:: + +@echo off + +SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v3.5 + +if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.\nuget.exe')" +.\nuget.exe install src\Sphereon.SDK.TemplateProcessor\packages.config -o packages + +if not exist ".\bin" mkdir bin + +copy packages\Newtonsoft.Json.10.0.3\lib\net35\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll +copy packages\JsonSubTypes.1.2.0\lib\net35\JsonSubTypes.dll bin\JsonSubTypes.dll +copy packages\RestSharp.105.1.0\lib\net35\RestSharp.dll bin\RestSharp.dll +%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll /target:library /out:bin\Sphereon.SDK.TemplateProcessor.dll /recurse:src\Sphereon.SDK.TemplateProcessor\*.cs /doc:bin\Sphereon.SDK.TemplateProcessor.xml + diff --git a/csharp-net35/build.sh b/csharp-net35/build.sh new file mode 100644 index 0000000..37f6619 --- /dev/null +++ b/csharp-net35/build.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +frameworkVersion=net35 + +# sdk must match installed framworks under PREFIX/lib/mono/[value] +sdk=4 + +# langversion refers to C# language features. see man mcs for details. +langversion=${sdk} +nuget_cmd=nuget + +# Match against our known SDK possibilities +case "${sdk}" in + 4) + langversion=4 + ;; + 4.5*) + langversion=5 + ;; + 4.6*) + langversion=6 + ;; + 4.7*) + langversion=7 # ignoring 7.1 for now. + ;; + *) + langversion=6 + ;; +esac + +echo "[INFO] Target framework: ${frameworkVersion}" + +if ! type nuget &>/dev/null; then + echo "[INFO] Download nuget and packages" + wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe; + nuget_cmd="mono nuget.exe" +fi + +mozroots --import --sync +${nuget_cmd} install src/Sphereon.SDK.TemplateProcessor/packages.config -o packages; + +echo "[INFO] Copy DLLs to the 'bin' folder" +mkdir -p bin; +cp packages/Newtonsoft.Json.10.0.3/lib/net35/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; +cp packages/RestSharp.105.1.0/lib/net35/RestSharp.dll bin/RestSharp.dll; +cp packages/JsonSubTypes.1.2.0/lib/net35/JsonSubTypes.dll bin/JsonSubTypes.dll + +echo "[INFO] Run 'mcs' to build bin/Sphereon.SDK.TemplateProcessor.dll" +mcs -langversion:${langversion} -sdk:${sdk} -r:bin/Newtonsoft.Json.dll,bin/JsonSubTypes.dll,\ +bin/RestSharp.dll,\ +System.ComponentModel.DataAnnotations.dll,\ +System.Runtime.Serialization.dll \ +-target:library \ +-out:bin/Sphereon.SDK.TemplateProcessor.dll \ +-recurse:'src/Sphereon.SDK.TemplateProcessor/*.cs' \ +-doc:bin/Sphereon.SDK.TemplateProcessor.xml \ +-platform:anycpu + +if [ $? -ne 0 ] +then + echo "[ERROR] Compilation failed with exit code $?" + exit 1 +else + echo "[INFO] bin/Sphereon.SDK.TemplateProcessor.dll was created successfully" +fi diff --git a/csharp-net35/git_push.sh b/csharp-net35/git_push.sh new file mode 100644 index 0000000..160f6f2 --- /dev/null +++ b/csharp-net35/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/csharp-net35/mono_nunit_test.sh b/csharp-net35/mono_nunit_test.sh new file mode 100644 index 0000000..55ec687 --- /dev/null +++ b/csharp-net35/mono_nunit_test.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe +mozroots --import --sync + +echo "[INFO] remove bin/Debug/SwaggerClientTest.dll" +rm src/Sphereon.SDK.TemplateProcessor.Test/bin/Debug/Sphereon.SDK.TemplateProcessor.Test.dll 2> /dev/null + +echo "[INFO] install NUnit runners via NuGet" +wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe +mozroots --import --sync +mono nuget.exe install src/Sphereon.SDK.TemplateProcessor.Test/packages.config -o packages + +echo "[INFO] Install NUnit runners via NuGet" +mono nuget.exe install NUnit.Runners -Version 2.6.4 -OutputDirectory packages + +echo "[INFO] Build the solution and run the unit test" +xbuild Sphereon.SDK.TemplateProcessor.sln && \ + mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/Sphereon.SDK.TemplateProcessor.Test/bin/Debug/Sphereon.SDK.TemplateProcessor.Test.dll diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/AllApiTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/AllApiTests.cs new file mode 100644 index 0000000..0236738 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/AllApiTests.cs @@ -0,0 +1,228 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing AllApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class AllApiTests + { + private AllApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new AllApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of AllApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' AllApi + //Assert.IsInstanceOfType(typeof(AllApi), instance, "instance is a AllApi"); + } + + + /// + /// Test CreateDataSet + /// + [Test] + public void CreateDataSetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string payload = null; + //var response = instance.CreateDataSet(payload); + //Assert.IsInstanceOf (response, "response is DataSetResponse"); + } + + /// + /// Test CreateTemplateContext + /// + [Test] + public void CreateTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //TemplateContextRequest templateRequest = null; + //var response = instance.CreateTemplateContext(templateRequest); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test DeleteDataSet + /// + [Test] + public void DeleteDataSetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string dataSetId = null; + //var response = instance.DeleteDataSet(dataSetId); + //Assert.IsInstanceOf (response, "response is DataSetResponse"); + } + + /// + /// Test DeleteJob + /// + [Test] + public void DeleteJobTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //var response = instance.DeleteJob(jobId); + //Assert.IsInstanceOf (response, "response is MergeJobResponse"); + } + + /// + /// Test DeleteTemplateContext + /// + [Test] + public void DeleteTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //var response = instance.DeleteTemplateContext(templateId); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test GetJob + /// + [Test] + public void GetJobTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //var response = instance.GetJob(jobId); + //Assert.IsInstanceOf (response, "response is MergeJobResponse"); + } + + /// + /// Test GetJobs + /// + [Test] + public void GetJobsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List status = null; + //var response = instance.GetJobs(status); + //Assert.IsInstanceOf> (response, "response is List"); + } + + /// + /// Test GetResultStream + /// + [Test] + public void GetResultStreamTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //ResultStreamRequest resultStreamRequest = null; + //var response = instance.GetResultStream(jobId, resultStreamRequest); + //Assert.IsInstanceOf (response, "response is byte[]"); + } + + /// + /// Test GetResultStreamsAsContainer + /// + [Test] + public void GetResultStreamsAsContainerTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //OutputSettings outputSettings = null; + //var response = instance.GetResultStreamsAsContainer(jobId, outputSettings); + //Assert.IsInstanceOf (response, "response is byte[]"); + } + + /// + /// Test GetTemplateContext + /// + [Test] + public void GetTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //var response = instance.GetTemplateContext(templateId); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test SubmitJob + /// + [Test] + public void SubmitJobTest() + { + // TODO uncomment below to test the method and replace null with proper value + //MergeSettings mergesettings = null; + //var response = instance.SubmitJob(mergesettings); + //Assert.IsInstanceOf (response, "response is MergeJobResponse"); + } + + /// + /// Test UpdateTemplateContext + /// + [Test] + public void UpdateTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //TemplateContext templateContext = null; + //var response = instance.UpdateTemplateContext(templateContext); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test UploadTemplateFile + /// + [Test] + public void UploadTemplateFileTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //System.IO.Stream stream = null; + //var response = instance.UploadTemplateFile(templateId, stream); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/DataSetApiTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/DataSetApiTests.cs new file mode 100644 index 0000000..8a6a2bc --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/DataSetApiTests.cs @@ -0,0 +1,93 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing DataSetApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class DataSetApiTests + { + private DataSetApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new DataSetApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of DataSetApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' DataSetApi + //Assert.IsInstanceOfType(typeof(DataSetApi), instance, "instance is a DataSetApi"); + } + + + /// + /// Test CreateDataSet + /// + [Test] + public void CreateDataSetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string payload = null; + //var response = instance.CreateDataSet(payload); + //Assert.IsInstanceOf (response, "response is DataSetResponse"); + } + + /// + /// Test DeleteDataSet + /// + [Test] + public void DeleteDataSetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string dataSetId = null; + //var response = instance.DeleteDataSet(dataSetId); + //Assert.IsInstanceOf (response, "response is DataSetResponse"); + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/JobApiTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/JobApiTests.cs new file mode 100644 index 0000000..c41db53 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/JobApiTests.cs @@ -0,0 +1,131 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing JobApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class JobApiTests + { + private JobApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new JobApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of JobApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' JobApi + //Assert.IsInstanceOfType(typeof(JobApi), instance, "instance is a JobApi"); + } + + + /// + /// Test GetJob + /// + [Test] + public void GetJobTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //var response = instance.GetJob(jobId); + //Assert.IsInstanceOf (response, "response is MergeJobResponse"); + } + + /// + /// Test GetJobs + /// + [Test] + public void GetJobsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List status = null; + //var response = instance.GetJobs(status); + //Assert.IsInstanceOf> (response, "response is List"); + } + + /// + /// Test GetResultStream + /// + [Test] + public void GetResultStreamTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //ResultStreamRequest resultStreamRequest = null; + //var response = instance.GetResultStream(jobId, resultStreamRequest); + //Assert.IsInstanceOf (response, "response is byte[]"); + } + + /// + /// Test GetResultStreamsAsContainer + /// + [Test] + public void GetResultStreamsAsContainerTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //OutputSettings outputSettings = null; + //var response = instance.GetResultStreamsAsContainer(jobId, outputSettings); + //Assert.IsInstanceOf (response, "response is byte[]"); + } + + /// + /// Test SubmitJob + /// + [Test] + public void SubmitJobTest() + { + // TODO uncomment below to test the method and replace null with proper value + //MergeSettings mergesettings = null; + //var response = instance.SubmitJob(mergesettings); + //Assert.IsInstanceOf (response, "response is MergeJobResponse"); + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/TemplateApiTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/TemplateApiTests.cs new file mode 100644 index 0000000..db43f20 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Api/TemplateApiTests.cs @@ -0,0 +1,130 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing TemplateApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class TemplateApiTests + { + private TemplateApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new TemplateApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of TemplateApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' TemplateApi + //Assert.IsInstanceOfType(typeof(TemplateApi), instance, "instance is a TemplateApi"); + } + + + /// + /// Test CreateTemplateContext + /// + [Test] + public void CreateTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //TemplateContextRequest templateRequest = null; + //var response = instance.CreateTemplateContext(templateRequest); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test DeleteTemplateContext + /// + [Test] + public void DeleteTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //var response = instance.DeleteTemplateContext(templateId); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test GetTemplateContext + /// + [Test] + public void GetTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //var response = instance.GetTemplateContext(templateId); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test UpdateTemplateContext + /// + [Test] + public void UpdateTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //TemplateContext templateContext = null; + //var response = instance.UpdateTemplateContext(templateContext); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test UploadTemplateFile + /// + [Test] + public void UploadTemplateFileTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //System.IO.Stream stream = null; + //var response = instance.UploadTemplateFile(templateId, stream); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ClaimParametersTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ClaimParametersTests.cs new file mode 100644 index 0000000..0a150b3 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ClaimParametersTests.cs @@ -0,0 +1,112 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing ClaimParameters + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ClaimParametersTests + { + // TODO uncomment below to declare an instance variable for ClaimParameters + //private ClaimParameters instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ClaimParameters + //instance = new ClaimParameters(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ClaimParameters + /// + [Test] + public void ClaimParametersInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ClaimParameters + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ClaimParameters"); + } + + + /// + /// Test the property 'ApiEndUser' + /// + [Test] + public void ApiEndUserTest() + { + // TODO unit test for the property 'ApiEndUser' + } + /// + /// Test the property 'ApplicationId' + /// + [Test] + public void ApplicationIdTest() + { + // TODO unit test for the property 'ApplicationId' + } + /// + /// Test the property 'KeyType' + /// + [Test] + public void KeyTypeTest() + { + // TODO unit test for the property 'KeyType' + } + /// + /// Test the property 'SphereonIdentifier' + /// + [Test] + public void SphereonIdentifierTest() + { + // TODO unit test for the property 'SphereonIdentifier' + } + /// + /// Test the property 'ApiSupplierTenantId' + /// + [Test] + public void ApiSupplierTenantIdTest() + { + // TODO unit test for the property 'ApiSupplierTenantId' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/DataSetResponseTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/DataSetResponseTests.cs new file mode 100644 index 0000000..1284c80 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/DataSetResponseTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing DataSetResponse + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class DataSetResponseTests + { + // TODO uncomment below to declare an instance variable for DataSetResponse + //private DataSetResponse instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of DataSetResponse + //instance = new DataSetResponse(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of DataSetResponse + /// + [Test] + public void DataSetResponseInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" DataSetResponse + //Assert.IsInstanceOfType (instance, "variable 'instance' is a DataSetResponse"); + } + + /// + /// Test the property 'CompletionTime' + /// + [Test] + public void CompletionTimeTest() + { + // TODO unit test for the property 'CompletionTime' + } + /// + /// Test the property 'CreationTime' + /// + [Test] + public void CreationTimeTest() + { + // TODO unit test for the property 'CreationTime' + } + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorResponseTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorResponseTests.cs new file mode 100644 index 0000000..96404c2 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorResponseTests.cs @@ -0,0 +1,78 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing ErrorResponse + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ErrorResponseTests + { + // TODO uncomment below to declare an instance variable for ErrorResponse + //private ErrorResponse instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ErrorResponse + //instance = new ErrorResponse(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ErrorResponse + /// + [Test] + public void ErrorResponseInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ErrorResponse + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ErrorResponse"); + } + + /// + /// Test the property 'Errors' + /// + [Test] + public void ErrorsTest() + { + // TODO unit test for the property 'Errors' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorTests.cs new file mode 100644 index 0000000..bfd1f3f --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing Error + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ErrorTests + { + // TODO uncomment below to declare an instance variable for Error + //private Error instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Error + //instance = new Error(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Error + /// + [Test] + public void ErrorInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Error + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Error"); + } + + /// + /// Test the property 'Code' + /// + [Test] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + /// + /// Test the property 'Level' + /// + [Test] + public void LevelTest() + { + // TODO unit test for the property 'Level' + } + /// + /// Test the property 'Cause' + /// + [Test] + public void CauseTest() + { + // TODO unit test for the property 'Cause' + } + /// + /// Test the property 'Message' + /// + [Test] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/LifecycleTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/LifecycleTests.cs new file mode 100644 index 0000000..fa03e6a --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/LifecycleTests.cs @@ -0,0 +1,94 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing Lifecycle + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class LifecycleTests + { + // TODO uncomment below to declare an instance variable for Lifecycle + //private Lifecycle instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Lifecycle + //instance = new Lifecycle(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Lifecycle + /// + [Test] + public void LifecycleInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Lifecycle + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Lifecycle"); + } + + /// + /// Test the property 'ActionTime' + /// + [Test] + public void ActionTimeTest() + { + // TODO unit test for the property 'ActionTime' + } + /// + /// Test the property 'Action' + /// + [Test] + public void ActionTest() + { + // TODO unit test for the property 'Action' + } + /// + /// Test the property 'Type' + /// + [Test] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobResponseTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobResponseTests.cs new file mode 100644 index 0000000..93fdf24 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobResponseTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing MergeJobResponse + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class MergeJobResponseTests + { + // TODO uncomment below to declare an instance variable for MergeJobResponse + //private MergeJobResponse instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of MergeJobResponse + //instance = new MergeJobResponse(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of MergeJobResponse + /// + [Test] + public void MergeJobResponseInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" MergeJobResponse + //Assert.IsInstanceOfType (instance, "variable 'instance' is a MergeJobResponse"); + } + + /// + /// Test the property 'JobId' + /// + [Test] + public void JobIdTest() + { + // TODO unit test for the property 'JobId' + } + /// + /// Test the property 'Job' + /// + [Test] + public void JobTest() + { + // TODO unit test for the property 'Job' + } + /// + /// Test the property 'StatusMessage' + /// + [Test] + public void StatusMessageTest() + { + // TODO unit test for the property 'StatusMessage' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobTests.cs new file mode 100644 index 0000000..2c8cecd --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobTests.cs @@ -0,0 +1,150 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing MergeJob + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class MergeJobTests + { + // TODO uncomment below to declare an instance variable for MergeJob + //private MergeJob instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of MergeJob + //instance = new MergeJob(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of MergeJob + /// + [Test] + public void MergeJobInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" MergeJob + //Assert.IsInstanceOfType (instance, "variable 'instance' is a MergeJob"); + } + + /// + /// Test the property 'CompletionTime' + /// + [Test] + public void CompletionTimeTest() + { + // TODO unit test for the property 'CompletionTime' + } + /// + /// Test the property 'JobId' + /// + [Test] + public void JobIdTest() + { + // TODO unit test for the property 'JobId' + } + /// + /// Test the property 'CreationTime' + /// + [Test] + public void CreationTimeTest() + { + // TODO unit test for the property 'CreationTime' + } + /// + /// Test the property 'DataSetId' + /// + [Test] + public void DataSetIdTest() + { + // TODO unit test for the property 'DataSetId' + } + /// + /// Test the property 'ResultStreams' + /// + [Test] + public void ResultStreamsTest() + { + // TODO unit test for the property 'ResultStreams' + } + /// + /// Test the property 'HeaderDataSetIds' + /// + [Test] + public void HeaderDataSetIdsTest() + { + // TODO unit test for the property 'HeaderDataSetIds' + } + /// + /// Test the property 'ResultStorageLocation' + /// + [Test] + public void ResultStorageLocationTest() + { + // TODO unit test for the property 'ResultStorageLocation' + } + /// + /// Test the property 'MergeSettings' + /// + [Test] + public void MergeSettingsTest() + { + // TODO unit test for the property 'MergeSettings' + } + /// + /// Test the property 'StatusMessage' + /// + [Test] + public void StatusMessageTest() + { + // TODO unit test for the property 'StatusMessage' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeSettingsTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeSettingsTests.cs new file mode 100644 index 0000000..cab853c --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeSettingsTests.cs @@ -0,0 +1,142 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing MergeSettings + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class MergeSettingsTests + { + // TODO uncomment below to declare an instance variable for MergeSettings + //private MergeSettings instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of MergeSettings + //instance = new MergeSettings(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of MergeSettings + /// + [Test] + public void MergeSettingsInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" MergeSettings + //Assert.IsInstanceOfType (instance, "variable 'instance' is a MergeSettings"); + } + + /// + /// Test the property 'Lifecycle' + /// + [Test] + public void LifecycleTest() + { + // TODO unit test for the property 'Lifecycle' + } + /// + /// Test the property 'MergeResult' + /// + [Test] + public void MergeResultTest() + { + // TODO unit test for the property 'MergeResult' + } + /// + /// Test the property 'DataSetId' + /// + [Test] + public void DataSetIdTest() + { + // TODO unit test for the property 'DataSetId' + } + /// + /// Test the property 'Engine' + /// + [Test] + public void EngineTest() + { + // TODO unit test for the property 'Engine' + } + /// + /// Test the property 'HeaderDataSetIds' + /// + [Test] + public void HeaderDataSetIdsTest() + { + // TODO unit test for the property 'HeaderDataSetIds' + } + /// + /// Test the property 'ResultStorageLocation' + /// + [Test] + public void ResultStorageLocationTest() + { + // TODO unit test for the property 'ResultStorageLocation' + } + /// + /// Test the property 'TemplateVersion' + /// + [Test] + public void TemplateVersionTest() + { + // TODO unit test for the property 'TemplateVersion' + } + /// + /// Test the property 'TemplateId' + /// + [Test] + public void TemplateIdTest() + { + // TODO unit test for the property 'TemplateId' + } + /// + /// Test the property 'OutputSettings' + /// + [Test] + public void OutputSettingsTest() + { + // TODO unit test for the property 'OutputSettings' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/OutputSettingsTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/OutputSettingsTests.cs new file mode 100644 index 0000000..dea791e --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/OutputSettingsTests.cs @@ -0,0 +1,86 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing OutputSettings + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OutputSettingsTests + { + // TODO uncomment below to declare an instance variable for OutputSettings + //private OutputSettings instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OutputSettings + //instance = new OutputSettings(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OutputSettings + /// + [Test] + public void OutputSettingsInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OutputSettings + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OutputSettings"); + } + + /// + /// Test the property 'DeliveryFormat' + /// + [Test] + public void DeliveryFormatTest() + { + // TODO unit test for the property 'DeliveryFormat' + } + /// + /// Test the property 'OutputFormat' + /// + [Test] + public void OutputFormatTest() + { + // TODO unit test for the property 'OutputFormat' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/OwnerInfoTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/OwnerInfoTests.cs new file mode 100644 index 0000000..6db728f --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/OwnerInfoTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing OwnerInfo + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OwnerInfoTests + { + // TODO uncomment below to declare an instance variable for OwnerInfo + //private OwnerInfo instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OwnerInfo + //instance = new OwnerInfo(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OwnerInfo + /// + [Test] + public void OwnerInfoInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OwnerInfo + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OwnerInfo"); + } + + /// + /// Test the property 'Phone' + /// + [Test] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + /// + /// Test the property 'CompanyDepartment' + /// + [Test] + public void CompanyDepartmentTest() + { + // TODO unit test for the property 'CompanyDepartment' + } + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'Email' + /// + [Test] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ResultStreamRequestTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ResultStreamRequestTests.cs new file mode 100644 index 0000000..f2639a9 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/ResultStreamRequestTests.cs @@ -0,0 +1,86 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing ResultStreamRequest + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ResultStreamRequestTests + { + // TODO uncomment below to declare an instance variable for ResultStreamRequest + //private ResultStreamRequest instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ResultStreamRequest + //instance = new ResultStreamRequest(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ResultStreamRequest + /// + [Test] + public void ResultStreamRequestInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ResultStreamRequest + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ResultStreamRequest"); + } + + /// + /// Test the property 'StreamLocation' + /// + [Test] + public void StreamLocationTest() + { + // TODO unit test for the property 'StreamLocation' + } + /// + /// Test the property 'OutputSettings' + /// + [Test] + public void OutputSettingsTest() + { + // TODO unit test for the property 'OutputSettings' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/StorageLocationTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/StorageLocationTests.cs new file mode 100644 index 0000000..ed9d640 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/StorageLocationTests.cs @@ -0,0 +1,86 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing StorageLocation + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class StorageLocationTests + { + // TODO uncomment below to declare an instance variable for StorageLocation + //private StorageLocation instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of StorageLocation + //instance = new StorageLocation(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of StorageLocation + /// + [Test] + public void StorageLocationInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" StorageLocation + //Assert.IsInstanceOfType (instance, "variable 'instance' is a StorageLocation"); + } + + /// + /// Test the property 'FolderPath' + /// + [Test] + public void FolderPathTest() + { + // TODO unit test for the property 'FolderPath' + } + /// + /// Test the property 'ContainerId' + /// + [Test] + public void ContainerIdTest() + { + // TODO unit test for the property 'ContainerId' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/StreamLocationTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/StreamLocationTests.cs new file mode 100644 index 0000000..50b14bc --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/StreamLocationTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing StreamLocation + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class StreamLocationTests + { + // TODO uncomment below to declare an instance variable for StreamLocation + //private StreamLocation instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of StreamLocation + //instance = new StreamLocation(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of StreamLocation + /// + [Test] + public void StreamLocationInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" StreamLocation + //Assert.IsInstanceOfType (instance, "variable 'instance' is a StreamLocation"); + } + + /// + /// Test the property 'FolderPath' + /// + [Test] + public void FolderPathTest() + { + // TODO unit test for the property 'FolderPath' + } + /// + /// Test the property 'OriginalFileName' + /// + [Test] + public void OriginalFileNameTest() + { + // TODO unit test for the property 'OriginalFileName' + } + /// + /// Test the property 'FileName' + /// + [Test] + public void FileNameTest() + { + // TODO unit test for the property 'FileName' + } + /// + /// Test the property 'ContainerId' + /// + [Test] + public void ContainerIdTest() + { + // TODO unit test for the property 'ContainerId' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextRequestTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextRequestTests.cs new file mode 100644 index 0000000..99f6b69 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextRequestTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing TemplateContextRequest + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class TemplateContextRequestTests + { + // TODO uncomment below to declare an instance variable for TemplateContextRequest + //private TemplateContextRequest instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of TemplateContextRequest + //instance = new TemplateContextRequest(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of TemplateContextRequest + /// + [Test] + public void TemplateContextRequestInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" TemplateContextRequest + //Assert.IsInstanceOfType (instance, "variable 'instance' is a TemplateContextRequest"); + } + + /// + /// Test the property 'TemplateType' + /// + [Test] + public void TemplateTypeTest() + { + // TODO unit test for the property 'TemplateType' + } + /// + /// Test the property 'Description' + /// + [Test] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + /// + /// Test the property 'OwnerInfo' + /// + [Test] + public void OwnerInfoTest() + { + // TODO unit test for the property 'OwnerInfo' + } + /// + /// Test the property 'TemplateId' + /// + [Test] + public void TemplateIdTest() + { + // TODO unit test for the property 'TemplateId' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextResponseTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextResponseTests.cs new file mode 100644 index 0000000..d9ff836 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextResponseTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing TemplateContextResponse + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class TemplateContextResponseTests + { + // TODO uncomment below to declare an instance variable for TemplateContextResponse + //private TemplateContextResponse instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of TemplateContextResponse + //instance = new TemplateContextResponse(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of TemplateContextResponse + /// + [Test] + public void TemplateContextResponseInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" TemplateContextResponse + //Assert.IsInstanceOfType (instance, "variable 'instance' is a TemplateContextResponse"); + } + + /// + /// Test the property 'CreationTime' + /// + [Test] + public void CreationTimeTest() + { + // TODO unit test for the property 'CreationTime' + } + /// + /// Test the property 'Context' + /// + [Test] + public void ContextTest() + { + // TODO unit test for the property 'Context' + } + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextTests.cs b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextTests.cs new file mode 100644 index 0000000..b4dfe48 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextTests.cs @@ -0,0 +1,126 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing TemplateContext + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class TemplateContextTests + { + // TODO uncomment below to declare an instance variable for TemplateContext + //private TemplateContext instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of TemplateContext + //instance = new TemplateContext(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of TemplateContext + /// + [Test] + public void TemplateContextInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" TemplateContext + //Assert.IsInstanceOfType (instance, "variable 'instance' is a TemplateContext"); + } + + /// + /// Test the property 'TemplateType' + /// + [Test] + public void TemplateTypeTest() + { + // TODO unit test for the property 'TemplateType' + } + /// + /// Test the property 'TemplateFileLocations' + /// + [Test] + public void TemplateFileLocationsTest() + { + // TODO unit test for the property 'TemplateFileLocations' + } + /// + /// Test the property 'Description' + /// + [Test] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + /// + /// Test the property 'OwnerInfo' + /// + [Test] + public void OwnerInfoTest() + { + // TODO unit test for the property 'OwnerInfo' + } + /// + /// Test the property 'StorageLocation' + /// + [Test] + public void StorageLocationTest() + { + // TODO unit test for the property 'StorageLocation' + } + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'TemplateId' + /// + [Test] + public void TemplateIdTest() + { + // TODO unit test for the property 'TemplateId' + } + + } + +} diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Sphereon.SDK.TemplateProcessor.Test.csproj b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Sphereon.SDK.TemplateProcessor.Test.csproj new file mode 100644 index 0000000..7cb0c44 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/Sphereon.SDK.TemplateProcessor.Test.csproj @@ -0,0 +1,89 @@ + + + + + Debug + AnyCPU + {19F1DEBC-DE5E-4517-8062-F000CD499087} + Library + Properties + Sphereon.SDK.TemplateProcessor.Test + Sphereon.SDK.TemplateProcessor.Test + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net35\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\net35\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.10.0.3\lib\net35\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.10.0.3\lib\net35\Newtonsoft.Json.dll + + + $(SolutionDir)\packages\JsonSubTypes.1.2.0\lib\net35\JsonSubTypes.dll + ..\packages\JsonSubTypes.1.2.0\lib\net35\JsonSubTypes.dll + ..\..\packages\JsonSubTypes.1.2.0\lib\net35\JsonSubTypes.dll + ..\..\vendor\JsonSubTypes.1.2.0\lib\net35\JsonSubTypes.dll + + + $(SolutionDir)\packages\RestSharp.105.1.0\lib\net35\RestSharp.dll + ..\packages\RestSharp.105.1.0\lib\net35\RestSharp.dll + ..\..\packages\RestSharp.105.1.0\lib\net35\RestSharp.dll + ..\..\vendor\RestSharp.105.1.0\lib\net35\RestSharp.dll + + + $(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + ..\..\vendor\NUnit.2.6.4\lib\nunit.framework.dll + + + + + + + + + + + + {D69606FB-2A3F-4363-A33C-4FAD5967BB66} + Sphereon.SDK.TemplateProcessor + + + + diff --git a/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/packages.config b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/packages.config new file mode 100644 index 0000000..403ae20 --- /dev/null +++ b/csharp-net35/src/Sphereon.SDK.TemplateProcessor.Test/packages.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/csharp-net45/.swagger-codegen/VERSION b/csharp-net45/.swagger-codegen/VERSION new file mode 100644 index 0000000..a625450 --- /dev/null +++ b/csharp-net45/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/csharp-net45/.travis.yml b/csharp-net45/.travis.yml index c4e7368..e6b6dff 100644 --- a/csharp-net45/.travis.yml +++ b/csharp-net45/.travis.yml @@ -1,21 +1,9 @@ # # Generated by: https://github.com/swagger-api/swagger-codegen.git # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# language: csharp mono: - latest -solution: Sphereon.SDK.Template.Processor.sln +solution: Sphereon.SDK.TemplateProcessor.sln script: - /bin/sh ./mono_nunit_test.sh diff --git a/csharp-net45/README.md b/csharp-net45/README.md index bbf6872..6a10ce9 100644 --- a/csharp-net45/README.md +++ b/csharp-net45/README.md @@ -1,24 +1,25 @@ -# Sphereon.SDK.Template.Processor - the C# library for the Template-Processor +# Sphereon.SDK.TemplateProcessor - the C# library for the Template-Processor The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 0.1 -- SDK version: 1.0.0 -- Build date: 2017-08-07T23:35:17.121+02:00 -- Build package: class io.swagger.codegen.languages.CSharpClientCodegen +- SDK version: 0.1.1 +- Build package: io.swagger.codegen.languages.CSharpClientCodegen For more information, please visit [https://sphereon.com](https://sphereon.com) + ## Frameworks supported - .NET 4.0 or later - Windows Phone 7.1 (Mango) + ## Dependencies - [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later -The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: ``` Install-Package RestSharp Install-Package Newtonsoft.Json @@ -26,6 +27,7 @@ Install-Package Newtonsoft.Json NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742) + ## Installation Run the following command to generate the DLL - [Mac/Linux] `/bin/sh build.sh` @@ -33,19 +35,32 @@ Run the following command to generate the DLL Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: ```csharp -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Model; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Model; ``` + +## Packaging +A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. + +This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: + +``` +nuget pack -Build -OutputDirectory out Sphereon.SDK.TemplateProcessor.csproj +``` + +Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. + + ## Getting Started ```csharp using System; using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Model; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Model; namespace Example { @@ -53,7 +68,7 @@ namespace Example { public void main() { - + // Configure OAuth2 access token for authorization: oauth2schema Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -70,6 +85,7 @@ namespace Example { Debug.Print("Exception when calling AllApi.CreateDataSet: " + e.Message ); } + } } } @@ -78,40 +94,41 @@ namespace Example ## Documentation for API Endpoints -All URIs are relative to *https://gw.api.cloud.sphereon.com/* +All URIs are relative to *https://gw.api.cloud.sphereon.com/template/processor/0.1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AllApi* | [**CreateDataSet**](docs/AllApi.md#createdataset) | **POST** /template/processor/0.1/datasets | Store dataset -*AllApi* | [**CreateTemplateContext**](docs/AllApi.md#createtemplatecontext) | **POST** /template/processor/0.1/templates | Create template context -*AllApi* | [**DeleteDataSet**](docs/AllApi.md#deletedataset) | **DELETE** /template/processor/0.1/datasets/{dataSetId} | Delete a stored data set -*AllApi* | [**DeleteJob**](docs/AllApi.md#deletejob) | **DELETE** /template/processor/0.1/jobs/{jobId} | Delete a job manually -*AllApi* | [**DeleteTemplateContext**](docs/AllApi.md#deletetemplatecontext) | **DELETE** /template/processor/0.1/templates/{templateId} | Delete template context -*AllApi* | [**GetJob**](docs/AllApi.md#getjob) | **GET** /template/processor/0.1/jobs/{jobId} | Job definition and state -*AllApi* | [**GetJobs**](docs/AllApi.md#getjobs) | **GET** /template/processor/0.1/jobs | Get all jobs -*AllApi* | [**GetResultStreamById**](docs/AllApi.md#getresultstreambyid) | **PUT** /template/processor/0.1/jobs/{jobId}/result/file/{streamId} | Get the result file -*AllApi* | [**GetResultStreamsAsContainer**](docs/AllApi.md#getresultstreamsascontainer) | **PUT** /template/processor/0.1/jobs/{jobId}/result/container | Get the result file -*AllApi* | [**GetTemplateContext**](docs/AllApi.md#gettemplatecontext) | **GET** /template/processor/0.1/templates/{templateId} | Get template context -*AllApi* | [**SubmitJob**](docs/AllApi.md#submitjob) | **PUT** /template/processor/0.1/jobs | Submit merge job for processing -*AllApi* | [**UpdateTemplateContext**](docs/AllApi.md#updatetemplatecontext) | **PUT** /template/processor/0.1/templates | Update template context -*AllApi* | [**UploadTemplateFile**](docs/AllApi.md#uploadtemplatefile) | **POST** /template/processor/0.1/templates/{templateId} | Upload template file -*DataSetApi* | [**CreateDataSet**](docs/DataSetApi.md#createdataset) | **POST** /template/processor/0.1/datasets | Store dataset -*DataSetApi* | [**DeleteDataSet**](docs/DataSetApi.md#deletedataset) | **DELETE** /template/processor/0.1/datasets/{dataSetId} | Delete a stored data set -*JobApi* | [**GetJob**](docs/JobApi.md#getjob) | **GET** /template/processor/0.1/jobs/{jobId} | Job definition and state -*JobApi* | [**GetJobs**](docs/JobApi.md#getjobs) | **GET** /template/processor/0.1/jobs | Get all jobs -*JobApi* | [**GetResultStreamById**](docs/JobApi.md#getresultstreambyid) | **PUT** /template/processor/0.1/jobs/{jobId}/result/file/{streamId} | Get the result file -*JobApi* | [**GetResultStreamsAsContainer**](docs/JobApi.md#getresultstreamsascontainer) | **PUT** /template/processor/0.1/jobs/{jobId}/result/container | Get the result file -*JobApi* | [**SubmitJob**](docs/JobApi.md#submitjob) | **PUT** /template/processor/0.1/jobs | Submit merge job for processing -*TemplateApi* | [**CreateTemplateContext**](docs/TemplateApi.md#createtemplatecontext) | **POST** /template/processor/0.1/templates | Create template context -*TemplateApi* | [**DeleteTemplateContext**](docs/TemplateApi.md#deletetemplatecontext) | **DELETE** /template/processor/0.1/templates/{templateId} | Delete template context -*TemplateApi* | [**GetTemplateContext**](docs/TemplateApi.md#gettemplatecontext) | **GET** /template/processor/0.1/templates/{templateId} | Get template context -*TemplateApi* | [**UpdateTemplateContext**](docs/TemplateApi.md#updatetemplatecontext) | **PUT** /template/processor/0.1/templates | Update template context -*TemplateApi* | [**UploadTemplateFile**](docs/TemplateApi.md#uploadtemplatefile) | **POST** /template/processor/0.1/templates/{templateId} | Upload template file +*AllApi* | [**CreateDataSet**](docs/AllApi.md#createdataset) | **POST** /datasets | Store dataset +*AllApi* | [**CreateTemplateContext**](docs/AllApi.md#createtemplatecontext) | **POST** /templates | Create template context +*AllApi* | [**DeleteDataSet**](docs/AllApi.md#deletedataset) | **DELETE** /datasets/{dataSetId} | Delete a stored data set +*AllApi* | [**DeleteJob**](docs/AllApi.md#deletejob) | **DELETE** /jobs/{jobId} | Delete a job manually +*AllApi* | [**DeleteTemplateContext**](docs/AllApi.md#deletetemplatecontext) | **DELETE** /templates/{templateId} | Delete template context +*AllApi* | [**GetJob**](docs/AllApi.md#getjob) | **GET** /jobs/{jobId} | Job definition and state +*AllApi* | [**GetJobs**](docs/AllApi.md#getjobs) | **GET** /jobs | Get all jobs +*AllApi* | [**GetResultStream**](docs/AllApi.md#getresultstream) | **PUT** /jobs/{jobId}/result/stream | Get the result file +*AllApi* | [**GetResultStreamsAsContainer**](docs/AllApi.md#getresultstreamsascontainer) | **PUT** /jobs/{jobId}/result/container | Get the result file +*AllApi* | [**GetTemplateContext**](docs/AllApi.md#gettemplatecontext) | **GET** /templates/{templateId} | Get template context +*AllApi* | [**SubmitJob**](docs/AllApi.md#submitjob) | **PUT** /jobs | Submit merge job for processing +*AllApi* | [**UpdateTemplateContext**](docs/AllApi.md#updatetemplatecontext) | **PUT** /templates | Update template context +*AllApi* | [**UploadTemplateFile**](docs/AllApi.md#uploadtemplatefile) | **POST** /templates/{templateId} | Upload template file +*DataSetApi* | [**CreateDataSet**](docs/DataSetApi.md#createdataset) | **POST** /datasets | Store dataset +*DataSetApi* | [**DeleteDataSet**](docs/DataSetApi.md#deletedataset) | **DELETE** /datasets/{dataSetId} | Delete a stored data set +*JobApi* | [**GetJob**](docs/JobApi.md#getjob) | **GET** /jobs/{jobId} | Job definition and state +*JobApi* | [**GetJobs**](docs/JobApi.md#getjobs) | **GET** /jobs | Get all jobs +*JobApi* | [**GetResultStream**](docs/JobApi.md#getresultstream) | **PUT** /jobs/{jobId}/result/stream | Get the result file +*JobApi* | [**GetResultStreamsAsContainer**](docs/JobApi.md#getresultstreamsascontainer) | **PUT** /jobs/{jobId}/result/container | Get the result file +*JobApi* | [**SubmitJob**](docs/JobApi.md#submitjob) | **PUT** /jobs | Submit merge job for processing +*TemplateApi* | [**CreateTemplateContext**](docs/TemplateApi.md#createtemplatecontext) | **POST** /templates | Create template context +*TemplateApi* | [**DeleteTemplateContext**](docs/TemplateApi.md#deletetemplatecontext) | **DELETE** /templates/{templateId} | Delete template context +*TemplateApi* | [**GetTemplateContext**](docs/TemplateApi.md#gettemplatecontext) | **GET** /templates/{templateId} | Get template context +*TemplateApi* | [**UpdateTemplateContext**](docs/TemplateApi.md#updatetemplatecontext) | **PUT** /templates | Update template context +*TemplateApi* | [**UploadTemplateFile**](docs/TemplateApi.md#uploadtemplatefile) | **POST** /templates/{templateId} | Upload template file ## Documentation for Models + - [Model.ClaimParameters](docs/ClaimParameters.md) - [Model.DataSetResponse](docs/DataSetResponse.md) - [Model.Error](docs/Error.md) - [Model.ErrorResponse](docs/ErrorResponse.md) @@ -121,14 +138,18 @@ Class | Method | HTTP request | Description - [Model.MergeSettings](docs/MergeSettings.md) - [Model.OutputSettings](docs/OutputSettings.md) - [Model.OwnerInfo](docs/OwnerInfo.md) + - [Model.ResultStreamRequest](docs/ResultStreamRequest.md) + - [Model.StorageLocation](docs/StorageLocation.md) - [Model.StreamLocation](docs/StreamLocation.md) - [Model.TemplateContext](docs/TemplateContext.md) - [Model.TemplateContextRequest](docs/TemplateContextRequest.md) - [Model.TemplateContextResponse](docs/TemplateContextResponse.md) + ## Documentation for Authorization + ### oauth2schema - **Type**: OAuth diff --git a/csharp-net45/Sphereon.SDK.TemplateProcessor.sln b/csharp-net45/Sphereon.SDK.TemplateProcessor.sln new file mode 100644 index 0000000..4474961 --- /dev/null +++ b/csharp-net45/Sphereon.SDK.TemplateProcessor.sln @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sphereon.SDK.TemplateProcessor", "src\Sphereon.SDK.TemplateProcessor\Sphereon.SDK.TemplateProcessor.csproj", "{AADC8EF1-2461-4634-BC88-69AE7CD89B3E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sphereon.SDK.TemplateProcessor.Test", "src\Sphereon.SDK.TemplateProcessor.Test\Sphereon.SDK.TemplateProcessor.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +Global +GlobalSection(SolutionConfigurationPlatforms) = preSolution +Debug|Any CPU = Debug|Any CPU +Release|Any CPU = Release|Any CPU +EndGlobalSection +GlobalSection(ProjectConfigurationPlatforms) = postSolution +{AADC8EF1-2461-4634-BC88-69AE7CD89B3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{AADC8EF1-2461-4634-BC88-69AE7CD89B3E}.Debug|Any CPU.Build.0 = Debug|Any CPU +{AADC8EF1-2461-4634-BC88-69AE7CD89B3E}.Release|Any CPU.ActiveCfg = Release|Any CPU +{AADC8EF1-2461-4634-BC88-69AE7CD89B3E}.Release|Any CPU.Build.0 = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU +EndGlobalSection +GlobalSection(SolutionProperties) = preSolution +HideSolutionNode = FALSE +EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/csharp-net45/build.bat b/csharp-net45/build.bat index 681f16a..552f3f1 100644 --- a/csharp-net45/build.bat +++ b/csharp-net45/build.bat @@ -1,28 +1,16 @@ :: Generated by: https://github.com/swagger-api/swagger-codegen.git :: -:: Licensed under the Apache License, Version 2.0 (the "License"); -:: you may not use this file except in compliance with the License. -:: You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, software -:: distributed under the License is distributed on an "AS IS" BASIS, -:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -:: See the License for the specific language governing permissions and -:: limitations under the License. @echo off SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319 - -if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')" -.\nuget.exe install src\Sphereon.SDK.Template.Processor\packages.config -o packages +if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.\nuget.exe')" +.\nuget.exe install src\Sphereon.SDK.TemplateProcessor\packages.config -o packages if not exist ".\bin" mkdir bin -copy packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll +copy packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll copy packages\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll +%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll /target:library /out:bin\Sphereon.SDK.TemplateProcessor.dll /recurse:src\Sphereon.SDK.TemplateProcessor\*.cs /doc:bin\Sphereon.SDK.TemplateProcessor.xml -%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\Sphereon.SDK.Template.Processor.dll /recurse:src\Sphereon.SDK.Template.Processor\*.cs /doc:bin\Sphereon.SDK.Template.Processor.xml diff --git a/csharp-net45/build.sh b/csharp-net45/build.sh index 193895e..9e9b257 100644 --- a/csharp-net45/build.sh +++ b/csharp-net45/build.sh @@ -2,17 +2,6 @@ # # Generated by: https://github.com/swagger-api/swagger-codegen.git # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. frameworkVersion=net45 netfx=${frameworkVersion#net} @@ -20,23 +9,24 @@ netfx=${frameworkVersion#net} echo "[INFO] Target framework: ${frameworkVersion}" echo "[INFO] Download nuget and packages" -wget -nc https://nuget.org/nuget.exe; +wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe; mozroots --import --sync -mono nuget.exe install src/Sphereon.SDK.Template.Processor/packages.config -o packages; +mono nuget.exe install src/Sphereon.SDK.TemplateProcessor/packages.config -o packages; echo "[INFO] Copy DLLs to the 'bin' folder" mkdir -p bin; -cp packages/Newtonsoft.Json.8.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; +cp packages/Newtonsoft.Json.10.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; cp packages/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll; -echo "[INFO] Run 'mcs' to build bin/Sphereon.SDK.Template.Processor.dll" +echo "[INFO] Run 'mcs' to build bin/Sphereon.SDK.TemplateProcessor.dll" mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\ bin/RestSharp.dll,\ +System.ComponentModel.DataAnnotations.dll,\ System.Runtime.Serialization.dll \ -target:library \ --out:bin/Sphereon.SDK.Template.Processor.dll \ --recurse:'src/Sphereon.SDK.Template.Processor/*.cs' \ --doc:bin/Sphereon.SDK.Template.Processor.xml \ +-out:bin/Sphereon.SDK.TemplateProcessor.dll \ +-recurse:'src/Sphereon.SDK.TemplateProcessor/*.cs' \ +-doc:bin/Sphereon.SDK.TemplateProcessor.xml \ -platform:anycpu if [ $? -ne 0 ] @@ -44,5 +34,5 @@ then echo "[ERROR] Compilation failed with exit code $?" exit 1 else - echo "[INFO] bin/Sphereon.SDK.Template.Processor.dll was created successfully" + echo "[INFO] bin/Sphereon.SDK.TemplateProcessor.dll was created successfully" fi diff --git a/csharp-net45/docs/AllApi.md b/csharp-net45/docs/AllApi.md deleted file mode 100644 index 79b749a..0000000 --- a/csharp-net45/docs/AllApi.md +++ /dev/null @@ -1,874 +0,0 @@ -# Sphereon.SDK.Template.Processor.Api.AllApi - -All URIs are relative to *https://gw.api.cloud.sphereon.com/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateDataSet**](AllApi.md#createdataset) | **POST** /template/processor/0.1/datasets | Store dataset -[**CreateTemplateContext**](AllApi.md#createtemplatecontext) | **POST** /template/processor/0.1/templates | Create template context -[**DeleteDataSet**](AllApi.md#deletedataset) | **DELETE** /template/processor/0.1/datasets/{dataSetId} | Delete a stored data set -[**DeleteJob**](AllApi.md#deletejob) | **DELETE** /template/processor/0.1/jobs/{jobId} | Delete a job manually -[**DeleteTemplateContext**](AllApi.md#deletetemplatecontext) | **DELETE** /template/processor/0.1/templates/{templateId} | Delete template context -[**GetJob**](AllApi.md#getjob) | **GET** /template/processor/0.1/jobs/{jobId} | Job definition and state -[**GetJobs**](AllApi.md#getjobs) | **GET** /template/processor/0.1/jobs | Get all jobs -[**GetResultStreamById**](AllApi.md#getresultstreambyid) | **PUT** /template/processor/0.1/jobs/{jobId}/result/file/{streamId} | Get the result file -[**GetResultStreamsAsContainer**](AllApi.md#getresultstreamsascontainer) | **PUT** /template/processor/0.1/jobs/{jobId}/result/container | Get the result file -[**GetTemplateContext**](AllApi.md#gettemplatecontext) | **GET** /template/processor/0.1/templates/{templateId} | Get template context -[**SubmitJob**](AllApi.md#submitjob) | **PUT** /template/processor/0.1/jobs | Submit merge job for processing -[**UpdateTemplateContext**](AllApi.md#updatetemplatecontext) | **PUT** /template/processor/0.1/templates | Update template context -[**UploadTemplateFile**](AllApi.md#uploadtemplatefile) | **POST** /template/processor/0.1/templates/{templateId} | Upload template file - - - -# **CreateDataSet** -> DataSetResponse CreateDataSet (string payload) - -Store dataset - -Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class CreateDataSetExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var payload = payload_example; // string | The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - - try - { - // Store dataset - DataSetResponse result = apiInstance.CreateDataSet(payload); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.CreateDataSet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **payload** | **string**| The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] | - -### Return type - -[**DataSetResponse**](DataSetResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **CreateTemplateContext** -> TemplateContextResponse CreateTemplateContext (TemplateContextRequest templateRequest) - -Create template context - -Create a unique template context for your environment - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class CreateTemplateContextExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var templateRequest = new TemplateContextRequest(); // TemplateContextRequest | The template request - - try - { - // Create template context - TemplateContextResponse result = apiInstance.CreateTemplateContext(templateRequest); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.CreateTemplateContext: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateRequest** | [**TemplateContextRequest**](TemplateContextRequest.md)| The template request | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **DeleteDataSet** -> DataSetResponse DeleteDataSet (string dataSetId) - -Delete a stored data set - -Delete a stored data set - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class DeleteDataSetExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var dataSetId = dataSetId_example; // string | dataSetId - - try - { - // Delete a stored data set - DataSetResponse result = apiInstance.DeleteDataSet(dataSetId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.DeleteDataSet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **dataSetId** | **string**| dataSetId | - -### Return type - -[**DataSetResponse**](DataSetResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **DeleteJob** -> MergeJobResponse DeleteJob (string jobId) - -Delete a job manually - -Delete the merge job and all related files - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class DeleteJobExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var jobId = jobId_example; // string | jobId - - try - { - // Delete a job manually - MergeJobResponse result = apiInstance.DeleteJob(jobId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.DeleteJob: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **string**| jobId | - -### Return type - -[**MergeJobResponse**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **DeleteTemplateContext** -> TemplateContextResponse DeleteTemplateContext (string templateId) - -Delete template context - -Delete a template context with all history - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class DeleteTemplateContextExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var templateId = templateId_example; // string | templateId - - try - { - // Delete template context - TemplateContextResponse result = apiInstance.DeleteTemplateContext(templateId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.DeleteTemplateContext: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **string**| templateId | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **GetJob** -> MergeJobResponse GetJob (string jobId) - -Job definition and state - -Get the merge job definition and current state. Please not that you can differentiate based on http response status - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class GetJobExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var jobId = jobId_example; // string | jobId - - try - { - // Job definition and state - MergeJobResponse result = apiInstance.GetJob(jobId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.GetJob: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **string**| jobId | - -### Return type - -[**MergeJobResponse**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **GetJobs** -> List GetJobs (List status = null) - -Get all jobs - -Get all office text job definitions and their current state. - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class GetJobsExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var status = new List(); // List | A list of status to filter on. (optional) - - try - { - // Get all jobs - List<MergeJobResponse> result = apiInstance.GetJobs(status); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.GetJobs: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List**](string.md)| A list of status to filter on. | [optional] - -### Return type - -[**List**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **GetResultStreamById** -> byte[] GetResultStreamById (string jobId, string streamId, OutputSettings outputSettings = null) - -Get the result file - -Get a merge result document as a binary stream. - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class GetResultStreamByIdExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var jobId = jobId_example; // string | jobId - var streamId = streamId_example; // string | streamId - var outputSettings = new OutputSettings(); // OutputSettings | outputSettings (optional) - - try - { - // Get the result file - byte[] result = apiInstance.GetResultStreamById(jobId, streamId, outputSettings); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.GetResultStreamById: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **string**| jobId | - **streamId** | **string**| streamId | - **outputSettings** | [**OutputSettings**](OutputSettings.md)| outputSettings | [optional] - -### Return type - -**byte[]** - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/octet-stream - -[[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) - - -# **GetResultStreamsAsContainer** -> byte[] GetResultStreamsAsContainer (string jobId, OutputSettings outputSettings = null) - -Get the result file - -Get all documents inside a compressed container as a binary stream. - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class GetResultStreamsAsContainerExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var jobId = jobId_example; // string | jobId - var outputSettings = new OutputSettings(); // OutputSettings | outputSettings (optional) - - try - { - // Get the result file - byte[] result = apiInstance.GetResultStreamsAsContainer(jobId, outputSettings); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.GetResultStreamsAsContainer: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **string**| jobId | - **outputSettings** | [**OutputSettings**](OutputSettings.md)| outputSettings | [optional] - -### Return type - -**byte[]** - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/octet-stream - -[[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) - - -# **GetTemplateContext** -> TemplateContextResponse GetTemplateContext (string templateId) - -Get template context - -Get an existing template context - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class GetTemplateContextExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var templateId = templateId_example; // string | The template context name unique for your environment - - try - { - // Get template context - TemplateContextResponse result = apiInstance.GetTemplateContext(templateId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.GetTemplateContext: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **string**| The template context name unique for your environment | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **SubmitJob** -> MergeJobResponse SubmitJob (MergeSettings mergesettings) - -Submit merge job for processing - -Submit merge job run. - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class SubmitJobExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var mergesettings = new MergeSettings(); // MergeSettings | The merge- and output settings - - try - { - // Submit merge job for processing - MergeJobResponse result = apiInstance.SubmitJob(mergesettings); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.SubmitJob: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **mergesettings** | [**MergeSettings**](MergeSettings.md)| The merge- and output settings | - -### Return type - -[**MergeJobResponse**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **UpdateTemplateContext** -> TemplateContextResponse UpdateTemplateContext (TemplateContextRequest templateContextRequest) - -Update template context - -Update an existing template context for your environment - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class UpdateTemplateContextExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var templateContextRequest = new TemplateContextRequest(); // TemplateContextRequest | templateContextRequest - - try - { - // Update template context - TemplateContextResponse result = apiInstance.UpdateTemplateContext(templateContextRequest); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.UpdateTemplateContext: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateContextRequest** | [**TemplateContextRequest**](TemplateContextRequest.md)| templateContextRequest | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **UploadTemplateFile** -> TemplateContextResponse UploadTemplateFile (string templateId, System.IO.Stream stream) - -Upload template file - -Upload the Office template file - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class UploadTemplateFileExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new AllApi(); - var templateId = templateId_example; // string | The template context name unique for your environment - var stream = new System.IO.Stream(); // System.IO.Stream | The template (file/inputstream) to store - - try - { - // Upload template file - TemplateContextResponse result = apiInstance.UploadTemplateFile(templateId, stream); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling AllApi.UploadTemplateFile: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **string**| The template context name unique for your environment | - **stream** | **System.IO.Stream**| The template (file/inputstream) to store | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json;charset=UTF-8 - -[[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/csharp-net45/docs/DataSetApi.md b/csharp-net45/docs/DataSetApi.md deleted file mode 100644 index d524a2d..0000000 --- a/csharp-net45/docs/DataSetApi.md +++ /dev/null @@ -1,140 +0,0 @@ -# Sphereon.SDK.Template.Processor.Api.DataSetApi - -All URIs are relative to *https://gw.api.cloud.sphereon.com/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateDataSet**](DataSetApi.md#createdataset) | **POST** /template/processor/0.1/datasets | Store dataset -[**DeleteDataSet**](DataSetApi.md#deletedataset) | **DELETE** /template/processor/0.1/datasets/{dataSetId} | Delete a stored data set - - - -# **CreateDataSet** -> DataSetResponse CreateDataSet (string payload) - -Store dataset - -Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class CreateDataSetExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new DataSetApi(); - var payload = payload_example; // string | The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - - try - { - // Store dataset - DataSetResponse result = apiInstance.CreateDataSet(payload); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling DataSetApi.CreateDataSet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **payload** | **string**| The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] | - -### Return type - -[**DataSetResponse**](DataSetResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **DeleteDataSet** -> DataSetResponse DeleteDataSet (string dataSetId) - -Delete a stored data set - -Delete a stored data set - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class DeleteDataSetExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new DataSetApi(); - var dataSetId = dataSetId_example; // string | dataSetId - - try - { - // Delete a stored data set - DataSetResponse result = apiInstance.DeleteDataSet(dataSetId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling DataSetApi.DeleteDataSet: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **dataSetId** | **string**| dataSetId | - -### Return type - -[**DataSetResponse**](DataSetResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - -[[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/csharp-net45/docs/DataSetResponse.md b/csharp-net45/docs/DataSetResponse.md deleted file mode 100644 index 84d999b..0000000 --- a/csharp-net45/docs/DataSetResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.DataSetResponse -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**CompletionTime** | **DateTime?** | The completion date/time of this template in ISO 8601 format | [optional] -**CreationTime** | **DateTime?** | The creation date/time of this template in ISO 8601 format | [optional] -**Id** | **string** | Unique dataset id | -**Status** | **string** | The status of the template | - -[[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/csharp-net45/docs/Error.md b/csharp-net45/docs/Error.md deleted file mode 100644 index 65b6b8f..0000000 --- a/csharp-net45/docs/Error.md +++ /dev/null @@ -1,12 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.Error -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | **string** | | -**Level** | **string** | | -**Cause** | [**Error**](Error.md) | | [optional] -**Message** | **string** | | - -[[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/csharp-net45/docs/ErrorResponse.md b/csharp-net45/docs/ErrorResponse.md deleted file mode 100644 index 058e42f..0000000 --- a/csharp-net45/docs/ErrorResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.ErrorResponse -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Errors** | [**List<Error>**](Error.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/csharp-net45/docs/JobApi.md b/csharp-net45/docs/JobApi.md deleted file mode 100644 index c9f5b2c..0000000 --- a/csharp-net45/docs/JobApi.md +++ /dev/null @@ -1,344 +0,0 @@ -# Sphereon.SDK.Template.Processor.Api.JobApi - -All URIs are relative to *https://gw.api.cloud.sphereon.com/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GetJob**](JobApi.md#getjob) | **GET** /template/processor/0.1/jobs/{jobId} | Job definition and state -[**GetJobs**](JobApi.md#getjobs) | **GET** /template/processor/0.1/jobs | Get all jobs -[**GetResultStreamById**](JobApi.md#getresultstreambyid) | **PUT** /template/processor/0.1/jobs/{jobId}/result/file/{streamId} | Get the result file -[**GetResultStreamsAsContainer**](JobApi.md#getresultstreamsascontainer) | **PUT** /template/processor/0.1/jobs/{jobId}/result/container | Get the result file -[**SubmitJob**](JobApi.md#submitjob) | **PUT** /template/processor/0.1/jobs | Submit merge job for processing - - - -# **GetJob** -> MergeJobResponse GetJob (string jobId) - -Job definition and state - -Get the merge job definition and current state. Please not that you can differentiate based on http response status - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class GetJobExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new JobApi(); - var jobId = jobId_example; // string | jobId - - try - { - // Job definition and state - MergeJobResponse result = apiInstance.GetJob(jobId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling JobApi.GetJob: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **string**| jobId | - -### Return type - -[**MergeJobResponse**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **GetJobs** -> List GetJobs (List status = null) - -Get all jobs - -Get all office text job definitions and their current state. - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class GetJobsExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new JobApi(); - var status = new List(); // List | A list of status to filter on. (optional) - - try - { - // Get all jobs - List<MergeJobResponse> result = apiInstance.GetJobs(status); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling JobApi.GetJobs: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List**](string.md)| A list of status to filter on. | [optional] - -### Return type - -[**List**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **GetResultStreamById** -> byte[] GetResultStreamById (string jobId, string streamId, OutputSettings outputSettings = null) - -Get the result file - -Get a merge result document as a binary stream. - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class GetResultStreamByIdExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new JobApi(); - var jobId = jobId_example; // string | jobId - var streamId = streamId_example; // string | streamId - var outputSettings = new OutputSettings(); // OutputSettings | outputSettings (optional) - - try - { - // Get the result file - byte[] result = apiInstance.GetResultStreamById(jobId, streamId, outputSettings); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling JobApi.GetResultStreamById: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **string**| jobId | - **streamId** | **string**| streamId | - **outputSettings** | [**OutputSettings**](OutputSettings.md)| outputSettings | [optional] - -### Return type - -**byte[]** - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/octet-stream - -[[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) - - -# **GetResultStreamsAsContainer** -> byte[] GetResultStreamsAsContainer (string jobId, OutputSettings outputSettings = null) - -Get the result file - -Get all documents inside a compressed container as a binary stream. - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class GetResultStreamsAsContainerExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new JobApi(); - var jobId = jobId_example; // string | jobId - var outputSettings = new OutputSettings(); // OutputSettings | outputSettings (optional) - - try - { - // Get the result file - byte[] result = apiInstance.GetResultStreamsAsContainer(jobId, outputSettings); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling JobApi.GetResultStreamsAsContainer: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **string**| jobId | - **outputSettings** | [**OutputSettings**](OutputSettings.md)| outputSettings | [optional] - -### Return type - -**byte[]** - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/octet-stream - -[[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) - - -# **SubmitJob** -> MergeJobResponse SubmitJob (MergeSettings mergesettings) - -Submit merge job for processing - -Submit merge job run. - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class SubmitJobExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new JobApi(); - var mergesettings = new MergeSettings(); // MergeSettings | The merge- and output settings - - try - { - // Submit merge job for processing - MergeJobResponse result = apiInstance.SubmitJob(mergesettings); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling JobApi.SubmitJob: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **mergesettings** | [**MergeSettings**](MergeSettings.md)| The merge- and output settings | - -### Return type - -[**MergeJobResponse**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - -[[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/csharp-net45/docs/Lifecycle.md b/csharp-net45/docs/Lifecycle.md deleted file mode 100644 index bbaef4b..0000000 --- a/csharp-net45/docs/Lifecycle.md +++ /dev/null @@ -1,11 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.Lifecycle -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ActionTime** | **DateTime?** | The time at which the job and files will be deleted, regardless of whether it has been retrieved or not. Maximal time is 1 day from job creation | [optional] -**Action** | **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/csharp-net45/docs/MergeJob.md b/csharp-net45/docs/MergeJob.md deleted file mode 100644 index 4bd146b..0000000 --- a/csharp-net45/docs/MergeJob.md +++ /dev/null @@ -1,19 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.MergeJob -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ResultFolderPath** | **string** | The target folder path of result files | [optional] -**CompletionTime** | **DateTime?** | The completion date/time of this job in ISO 8601 format | [optional] -**JobId** | **string** | The server generated job jobId. This jobId is checked against the jobId in the request path on every invocation | -**ResultContainerId** | **string** | The target container id of result files | [optional] -**CreationTime** | **DateTime?** | The creation date/time of this job in ISO 8601 format | [optional] -**DataSetId** | **string** | Data set id | [optional] -**ResultStreams** | [**List<StreamLocation>**](StreamLocation.md) | The storage locations of the result files. | -**HeaderDataSetIds** | **List<string>** | Header data set ids | [optional] -**MergeSettings** | [**MergeSettings**](MergeSettings.md) | | [optional] -**StatusMessage** | **string** | A status message, which can be informational, warning or error. A message here does not indicate an error perse | [optional] -**Status** | **string** | The status of the job | - -[[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/csharp-net45/docs/MergeJobResponse.md b/csharp-net45/docs/MergeJobResponse.md deleted file mode 100644 index 4380b63..0000000 --- a/csharp-net45/docs/MergeJobResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.MergeJobResponse -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**JobId** | **string** | The server generated job jobId. This jobId is checked against the jobId in the request path on overy invocation | -**Job** | [**MergeJob**](MergeJob.md) | | [optional] -**StatusMessage** | **string** | A status message, which can be informational, warning or error. AA message here does not indicate an error perse | [optional] -**Status** | **string** | The status of the job | - -[[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/csharp-net45/docs/MergeSettings.md b/csharp-net45/docs/MergeSettings.md deleted file mode 100644 index fa4af60..0000000 --- a/csharp-net45/docs/MergeSettings.md +++ /dev/null @@ -1,17 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.MergeSettings -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Lifecycle** | [**Lifecycle**](Lifecycle.md) | | [optional] -**MergeResult** | **string** | | [optional] -**DataSetId** | **string** | Data set id | -**Engine** | **string** | | [optional] -**HeaderDataSetIds** | **List<string>** | optional header data set ids | [optional] -**TemplateVersion** | **int?** | Template version | [optional] -**ResultStreamLocation** | [**StreamLocation**](StreamLocation.md) | The output location of the result files. | -**TemplateId** | **string** | Template id | -**OutputSettings** | [**OutputSettings**](OutputSettings.md) | | - -[[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/csharp-net45/docs/OutputSettings.md b/csharp-net45/docs/OutputSettings.md deleted file mode 100644 index b927a58..0000000 --- a/csharp-net45/docs/OutputSettings.md +++ /dev/null @@ -1,10 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.OutputSettings -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DeliveryFormat** | **string** | | [optional] -**OutputFormat** | **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/csharp-net45/docs/OwnerInfo.md b/csharp-net45/docs/OwnerInfo.md deleted file mode 100644 index 8b93489..0000000 --- a/csharp-net45/docs/OwnerInfo.md +++ /dev/null @@ -1,12 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.OwnerInfo -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Phone** | **string** | The owner's phone number | [optional] -**CompanyDepartment** | **string** | The owner's company/department | [optional] -**Name** | **string** | The owner's name | [optional] -**Email** | **string** | The owner's email address | [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/csharp-net45/docs/StreamLocation.md b/csharp-net45/docs/StreamLocation.md deleted file mode 100644 index 6304690..0000000 --- a/csharp-net45/docs/StreamLocation.md +++ /dev/null @@ -1,12 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.StreamLocation -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**FolderPath** | **string** | | [optional] -**OriginalFileName** | **string** | | [optional] -**ContainerId** | **string** | | [optional] -**FileId** | **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/csharp-net45/docs/TemplateApi.md b/csharp-net45/docs/TemplateApi.md deleted file mode 100644 index 57ec829..0000000 --- a/csharp-net45/docs/TemplateApi.md +++ /dev/null @@ -1,340 +0,0 @@ -# Sphereon.SDK.Template.Processor.Api.TemplateApi - -All URIs are relative to *https://gw.api.cloud.sphereon.com/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateTemplateContext**](TemplateApi.md#createtemplatecontext) | **POST** /template/processor/0.1/templates | Create template context -[**DeleteTemplateContext**](TemplateApi.md#deletetemplatecontext) | **DELETE** /template/processor/0.1/templates/{templateId} | Delete template context -[**GetTemplateContext**](TemplateApi.md#gettemplatecontext) | **GET** /template/processor/0.1/templates/{templateId} | Get template context -[**UpdateTemplateContext**](TemplateApi.md#updatetemplatecontext) | **PUT** /template/processor/0.1/templates | Update template context -[**UploadTemplateFile**](TemplateApi.md#uploadtemplatefile) | **POST** /template/processor/0.1/templates/{templateId} | Upload template file - - - -# **CreateTemplateContext** -> TemplateContextResponse CreateTemplateContext (TemplateContextRequest templateRequest) - -Create template context - -Create a unique template context for your environment - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class CreateTemplateContextExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new TemplateApi(); - var templateRequest = new TemplateContextRequest(); // TemplateContextRequest | The template request - - try - { - // Create template context - TemplateContextResponse result = apiInstance.CreateTemplateContext(templateRequest); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling TemplateApi.CreateTemplateContext: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateRequest** | [**TemplateContextRequest**](TemplateContextRequest.md)| The template request | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **DeleteTemplateContext** -> TemplateContextResponse DeleteTemplateContext (string templateId) - -Delete template context - -Delete a template context with all history - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class DeleteTemplateContextExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new TemplateApi(); - var templateId = templateId_example; // string | templateId - - try - { - // Delete template context - TemplateContextResponse result = apiInstance.DeleteTemplateContext(templateId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling TemplateApi.DeleteTemplateContext: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **string**| templateId | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **GetTemplateContext** -> TemplateContextResponse GetTemplateContext (string templateId) - -Get template context - -Get an existing template context - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class GetTemplateContextExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new TemplateApi(); - var templateId = templateId_example; // string | The template context name unique for your environment - - try - { - // Get template context - TemplateContextResponse result = apiInstance.GetTemplateContext(templateId); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling TemplateApi.GetTemplateContext: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **string**| The template context name unique for your environment | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **UpdateTemplateContext** -> TemplateContextResponse UpdateTemplateContext (TemplateContextRequest templateContextRequest) - -Update template context - -Update an existing template context for your environment - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class UpdateTemplateContextExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new TemplateApi(); - var templateContextRequest = new TemplateContextRequest(); // TemplateContextRequest | templateContextRequest - - try - { - // Update template context - TemplateContextResponse result = apiInstance.UpdateTemplateContext(templateContextRequest); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling TemplateApi.UpdateTemplateContext: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateContextRequest** | [**TemplateContextRequest**](TemplateContextRequest.md)| templateContextRequest | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - -[[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) - - -# **UploadTemplateFile** -> TemplateContextResponse UploadTemplateFile (string templateId, System.IO.Stream stream) - -Upload template file - -Upload the Office template file - -### Example -```csharp -using System; -using System.Diagnostics; -using Sphereon.SDK.Template.Processor.Api; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Example -{ - public class UploadTemplateFileExample - { - public void main() - { - - // Configure OAuth2 access token for authorization: oauth2schema - Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - - var apiInstance = new TemplateApi(); - var templateId = templateId_example; // string | The template context name unique for your environment - var stream = new System.IO.Stream(); // System.IO.Stream | The template (file/inputstream) to store - - try - { - // Upload template file - TemplateContextResponse result = apiInstance.UploadTemplateFile(templateId, stream); - Debug.WriteLine(result); - } - catch (Exception e) - { - Debug.Print("Exception when calling TemplateApi.UploadTemplateFile: " + e.Message ); - } - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **string**| The template context name unique for your environment | - **stream** | **System.IO.Stream**| The template (file/inputstream) to store | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json;charset=UTF-8 - -[[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/csharp-net45/docs/TemplateContext.md b/csharp-net45/docs/TemplateContext.md deleted file mode 100644 index 4f1c866..0000000 --- a/csharp-net45/docs/TemplateContext.md +++ /dev/null @@ -1,14 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.TemplateContext -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**TemplateType** | **string** | | -**TemplateFileLocations** | [**Dictionary<string, StreamLocation>**](StreamLocation.md) | The template files (versioned) | [optional] -**Description** | **string** | The template description | [optional] -**OwnerInfo** | [**OwnerInfo**](OwnerInfo.md) | | [optional] -**Id** | **string** | | [optional] -**TemplateId** | **string** | The template context id | [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/csharp-net45/docs/TemplateContextRequest.md b/csharp-net45/docs/TemplateContextRequest.md deleted file mode 100644 index 0818dbf..0000000 --- a/csharp-net45/docs/TemplateContextRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.TemplateContextRequest -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**TemplateType** | **string** | | -**Description** | **string** | | [optional] -**OwnerInfo** | [**OwnerInfo**](OwnerInfo.md) | | [optional] -**TemplateId** | **string** | The template context id | [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/csharp-net45/docs/TemplateContextResponse.md b/csharp-net45/docs/TemplateContextResponse.md deleted file mode 100644 index 5ac599d..0000000 --- a/csharp-net45/docs/TemplateContextResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# Sphereon.SDK.Template.Processor.Model.TemplateContextResponse -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**CreationTime** | **DateTime?** | The creation date/time of this response in ISO 8601 format | [optional] -**Context** | [**TemplateContext**](TemplateContext.md) | | [optional] -**Id** | **string** | Unique template context id | -**Status** | **string** | The status of the template | - -[[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/csharp-net45/mono_nunit_test.sh b/csharp-net45/mono_nunit_test.sh index 0c4b961..55ec687 100644 --- a/csharp-net45/mono_nunit_test.sh +++ b/csharp-net45/mono_nunit_test.sh @@ -2,32 +2,21 @@ # # Generated by: https://github.com/swagger-api/swagger-codegen.git # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -wget -nc https://nuget.org/nuget.exe +wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe mozroots --import --sync echo "[INFO] remove bin/Debug/SwaggerClientTest.dll" -rm src/IO.Swagger.Test/bin/Debug/Sphereon.SDK.Template.Processor.Test.dll 2> /dev/null +rm src/Sphereon.SDK.TemplateProcessor.Test/bin/Debug/Sphereon.SDK.TemplateProcessor.Test.dll 2> /dev/null echo "[INFO] install NUnit runners via NuGet" -wget -nc https://nuget.org/nuget.exe +wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe mozroots --import --sync -mono nuget.exe install src/Sphereon.SDK.Template.Processor.Test/packages.config -o packages +mono nuget.exe install src/Sphereon.SDK.TemplateProcessor.Test/packages.config -o packages echo "[INFO] Install NUnit runners via NuGet" mono nuget.exe install NUnit.Runners -Version 2.6.4 -OutputDirectory packages echo "[INFO] Build the solution and run the unit test" -xbuild Sphereon.SDK.Template.Processor.sln && \ - mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/Sphereon.SDK.Template.Processor.Test/bin/Debug/Sphereon.SDK.Template.Processor.Test.dll +xbuild Sphereon.SDK.TemplateProcessor.sln && \ + mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/Sphereon.SDK.TemplateProcessor.Test/bin/Debug/Sphereon.SDK.TemplateProcessor.Test.dll diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/AllApi.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/AllApi.cs deleted file mode 100644 index b9fd787..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/AllApi.cs +++ /dev/null @@ -1,2845 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Sphereon.SDK.Template.Processor.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IAllApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Store dataset - /// - /// - /// Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// DataSetResponse - DataSetResponse CreateDataSet (string payload); - - /// - /// Store dataset - /// - /// - /// Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// ApiResponse of DataSetResponse - ApiResponse CreateDataSetWithHttpInfo (string payload); - /// - /// Create template context - /// - /// - /// Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// TemplateContextResponse - TemplateContextResponse CreateTemplateContext (TemplateContextRequest templateRequest); - - /// - /// Create template context - /// - /// - /// Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// ApiResponse of TemplateContextResponse - ApiResponse CreateTemplateContextWithHttpInfo (TemplateContextRequest templateRequest); - /// - /// Delete a stored data set - /// - /// - /// Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// DataSetResponse - DataSetResponse DeleteDataSet (string dataSetId); - - /// - /// Delete a stored data set - /// - /// - /// Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// ApiResponse of DataSetResponse - ApiResponse DeleteDataSetWithHttpInfo (string dataSetId); - /// - /// Delete a job manually - /// - /// - /// Delete the merge job and all related files - /// - /// Thrown when fails to make API call - /// jobId - /// MergeJobResponse - MergeJobResponse DeleteJob (string jobId); - - /// - /// Delete a job manually - /// - /// - /// Delete the merge job and all related files - /// - /// Thrown when fails to make API call - /// jobId - /// ApiResponse of MergeJobResponse - ApiResponse DeleteJobWithHttpInfo (string jobId); - /// - /// Delete template context - /// - /// - /// Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// TemplateContextResponse - TemplateContextResponse DeleteTemplateContext (string templateId); - - /// - /// Delete template context - /// - /// - /// Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// ApiResponse of TemplateContextResponse - ApiResponse DeleteTemplateContextWithHttpInfo (string templateId); - /// - /// Job definition and state - /// - /// - /// Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// MergeJobResponse - MergeJobResponse GetJob (string jobId); - - /// - /// Job definition and state - /// - /// - /// Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// ApiResponse of MergeJobResponse - ApiResponse GetJobWithHttpInfo (string jobId); - /// - /// Get all jobs - /// - /// - /// Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// List<MergeJobResponse> - List GetJobs (List status = null); - - /// - /// Get all jobs - /// - /// - /// Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// ApiResponse of List<MergeJobResponse> - ApiResponse> GetJobsWithHttpInfo (List status = null); - /// - /// Get the result file - /// - /// - /// Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// byte[] - byte[] GetResultStreamById (string jobId, string streamId, OutputSettings outputSettings = null); - - /// - /// Get the result file - /// - /// - /// Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// ApiResponse of byte[] - ApiResponse GetResultStreamByIdWithHttpInfo (string jobId, string streamId, OutputSettings outputSettings = null); - /// - /// Get the result file - /// - /// - /// Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// byte[] - byte[] GetResultStreamsAsContainer (string jobId, OutputSettings outputSettings = null); - - /// - /// Get the result file - /// - /// - /// Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// ApiResponse of byte[] - ApiResponse GetResultStreamsAsContainerWithHttpInfo (string jobId, OutputSettings outputSettings = null); - /// - /// Get template context - /// - /// - /// Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// TemplateContextResponse - TemplateContextResponse GetTemplateContext (string templateId); - - /// - /// Get template context - /// - /// - /// Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// ApiResponse of TemplateContextResponse - ApiResponse GetTemplateContextWithHttpInfo (string templateId); - /// - /// Submit merge job for processing - /// - /// - /// Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// MergeJobResponse - MergeJobResponse SubmitJob (MergeSettings mergesettings); - - /// - /// Submit merge job for processing - /// - /// - /// Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// ApiResponse of MergeJobResponse - ApiResponse SubmitJobWithHttpInfo (MergeSettings mergesettings); - /// - /// Update template context - /// - /// - /// Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// TemplateContextResponse - TemplateContextResponse UpdateTemplateContext (TemplateContextRequest templateContextRequest); - - /// - /// Update template context - /// - /// - /// Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// ApiResponse of TemplateContextResponse - ApiResponse UpdateTemplateContextWithHttpInfo (TemplateContextRequest templateContextRequest); - /// - /// Upload template file - /// - /// - /// Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// TemplateContextResponse - TemplateContextResponse UploadTemplateFile (string templateId, System.IO.Stream stream); - - /// - /// Upload template file - /// - /// - /// Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// ApiResponse of TemplateContextResponse - ApiResponse UploadTemplateFileWithHttpInfo (string templateId, System.IO.Stream stream); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Store dataset - /// - /// - /// Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// Task of DataSetResponse - System.Threading.Tasks.Task CreateDataSetAsync (string payload); - - /// - /// Store dataset - /// - /// - /// Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// Task of ApiResponse (DataSetResponse) - System.Threading.Tasks.Task> CreateDataSetAsyncWithHttpInfo (string payload); - /// - /// Create template context - /// - /// - /// Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// Task of TemplateContextResponse - System.Threading.Tasks.Task CreateTemplateContextAsync (TemplateContextRequest templateRequest); - - /// - /// Create template context - /// - /// - /// Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// Task of ApiResponse (TemplateContextResponse) - System.Threading.Tasks.Task> CreateTemplateContextAsyncWithHttpInfo (TemplateContextRequest templateRequest); - /// - /// Delete a stored data set - /// - /// - /// Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// Task of DataSetResponse - System.Threading.Tasks.Task DeleteDataSetAsync (string dataSetId); - - /// - /// Delete a stored data set - /// - /// - /// Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// Task of ApiResponse (DataSetResponse) - System.Threading.Tasks.Task> DeleteDataSetAsyncWithHttpInfo (string dataSetId); - /// - /// Delete a job manually - /// - /// - /// Delete the merge job and all related files - /// - /// Thrown when fails to make API call - /// jobId - /// Task of MergeJobResponse - System.Threading.Tasks.Task DeleteJobAsync (string jobId); - - /// - /// Delete a job manually - /// - /// - /// Delete the merge job and all related files - /// - /// Thrown when fails to make API call - /// jobId - /// Task of ApiResponse (MergeJobResponse) - System.Threading.Tasks.Task> DeleteJobAsyncWithHttpInfo (string jobId); - /// - /// Delete template context - /// - /// - /// Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// Task of TemplateContextResponse - System.Threading.Tasks.Task DeleteTemplateContextAsync (string templateId); - - /// - /// Delete template context - /// - /// - /// Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// Task of ApiResponse (TemplateContextResponse) - System.Threading.Tasks.Task> DeleteTemplateContextAsyncWithHttpInfo (string templateId); - /// - /// Job definition and state - /// - /// - /// Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// Task of MergeJobResponse - System.Threading.Tasks.Task GetJobAsync (string jobId); - - /// - /// Job definition and state - /// - /// - /// Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// Task of ApiResponse (MergeJobResponse) - System.Threading.Tasks.Task> GetJobAsyncWithHttpInfo (string jobId); - /// - /// Get all jobs - /// - /// - /// Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// Task of List<MergeJobResponse> - System.Threading.Tasks.Task> GetJobsAsync (List status = null); - - /// - /// Get all jobs - /// - /// - /// Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// Task of ApiResponse (List<MergeJobResponse>) - System.Threading.Tasks.Task>> GetJobsAsyncWithHttpInfo (List status = null); - /// - /// Get the result file - /// - /// - /// Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// Task of byte[] - System.Threading.Tasks.Task GetResultStreamByIdAsync (string jobId, string streamId, OutputSettings outputSettings = null); - - /// - /// Get the result file - /// - /// - /// Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// Task of ApiResponse (byte[]) - System.Threading.Tasks.Task> GetResultStreamByIdAsyncWithHttpInfo (string jobId, string streamId, OutputSettings outputSettings = null); - /// - /// Get the result file - /// - /// - /// Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// Task of byte[] - System.Threading.Tasks.Task GetResultStreamsAsContainerAsync (string jobId, OutputSettings outputSettings = null); - - /// - /// Get the result file - /// - /// - /// Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// Task of ApiResponse (byte[]) - System.Threading.Tasks.Task> GetResultStreamsAsContainerAsyncWithHttpInfo (string jobId, OutputSettings outputSettings = null); - /// - /// Get template context - /// - /// - /// Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// Task of TemplateContextResponse - System.Threading.Tasks.Task GetTemplateContextAsync (string templateId); - - /// - /// Get template context - /// - /// - /// Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// Task of ApiResponse (TemplateContextResponse) - System.Threading.Tasks.Task> GetTemplateContextAsyncWithHttpInfo (string templateId); - /// - /// Submit merge job for processing - /// - /// - /// Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// Task of MergeJobResponse - System.Threading.Tasks.Task SubmitJobAsync (MergeSettings mergesettings); - - /// - /// Submit merge job for processing - /// - /// - /// Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// Task of ApiResponse (MergeJobResponse) - System.Threading.Tasks.Task> SubmitJobAsyncWithHttpInfo (MergeSettings mergesettings); - /// - /// Update template context - /// - /// - /// Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// Task of TemplateContextResponse - System.Threading.Tasks.Task UpdateTemplateContextAsync (TemplateContextRequest templateContextRequest); - - /// - /// Update template context - /// - /// - /// Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// Task of ApiResponse (TemplateContextResponse) - System.Threading.Tasks.Task> UpdateTemplateContextAsyncWithHttpInfo (TemplateContextRequest templateContextRequest); - /// - /// Upload template file - /// - /// - /// Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// Task of TemplateContextResponse - System.Threading.Tasks.Task UploadTemplateFileAsync (string templateId, System.IO.Stream stream); - - /// - /// Upload template file - /// - /// - /// Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// Task of ApiResponse (TemplateContextResponse) - System.Threading.Tasks.Task> UploadTemplateFileAsyncWithHttpInfo (string templateId, System.IO.Stream stream); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class AllApi : IAllApi - { - private Sphereon.SDK.Template.Processor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public AllApi(String basePath) - { - this.Configuration = new Configuration(new ApiClient(basePath)); - - ExceptionFactory = Sphereon.SDK.Template.Processor.Client.Configuration.DefaultExceptionFactory; - - // ensure API client has configuration ready - if (Configuration.ApiClient.Configuration == null) - { - this.Configuration.ApiClient.Configuration = this.Configuration; - } - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public AllApi(Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = Sphereon.SDK.Template.Processor.Client.Configuration.DefaultExceptionFactory; - - // ensure API client has configuration ready - if (Configuration.ApiClient.Configuration == null) - { - this.Configuration.ApiClient.Configuration = this.Configuration; - } - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public Sphereon.SDK.Template.Processor.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public Dictionary DefaultHeader() - { - return this.Configuration.DefaultHeader; - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Store dataset Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// DataSetResponse - public DataSetResponse CreateDataSet (string payload) - { - ApiResponse localVarResponse = CreateDataSetWithHttpInfo(payload); - return localVarResponse.Data; - } - - /// - /// Store dataset Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// ApiResponse of DataSetResponse - public ApiResponse< DataSetResponse > CreateDataSetWithHttpInfo (string payload) - { - // verify the required parameter 'payload' is set - if (payload == null) - throw new ApiException(400, "Missing required parameter 'payload' when calling AllApi->CreateDataSet"); - - var localVarPath = "/template/processor/0.1/datasets"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (payload != null && payload.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(payload); // http body (model) parameter - } - else - { - localVarPostBody = payload; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateDataSet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (DataSetResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DataSetResponse))); - - } - - /// - /// Store dataset Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// Task of DataSetResponse - public async System.Threading.Tasks.Task CreateDataSetAsync (string payload) - { - ApiResponse localVarResponse = await CreateDataSetAsyncWithHttpInfo(payload); - return localVarResponse.Data; - - } - - /// - /// Store dataset Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// Task of ApiResponse (DataSetResponse) - public async System.Threading.Tasks.Task> CreateDataSetAsyncWithHttpInfo (string payload) - { - // verify the required parameter 'payload' is set - if (payload == null) - throw new ApiException(400, "Missing required parameter 'payload' when calling AllApi->CreateDataSet"); - - var localVarPath = "/template/processor/0.1/datasets"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (payload != null && payload.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(payload); // http body (model) parameter - } - else - { - localVarPostBody = payload; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateDataSet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (DataSetResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DataSetResponse))); - - } - - /// - /// Create template context Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// TemplateContextResponse - public TemplateContextResponse CreateTemplateContext (TemplateContextRequest templateRequest) - { - ApiResponse localVarResponse = CreateTemplateContextWithHttpInfo(templateRequest); - return localVarResponse.Data; - } - - /// - /// Create template context Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// ApiResponse of TemplateContextResponse - public ApiResponse< TemplateContextResponse > CreateTemplateContextWithHttpInfo (TemplateContextRequest templateRequest) - { - // verify the required parameter 'templateRequest' is set - if (templateRequest == null) - throw new ApiException(400, "Missing required parameter 'templateRequest' when calling AllApi->CreateTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateRequest != null && templateRequest.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(templateRequest); // http body (model) parameter - } - else - { - localVarPostBody = templateRequest; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Create template context Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// Task of TemplateContextResponse - public async System.Threading.Tasks.Task CreateTemplateContextAsync (TemplateContextRequest templateRequest) - { - ApiResponse localVarResponse = await CreateTemplateContextAsyncWithHttpInfo(templateRequest); - return localVarResponse.Data; - - } - - /// - /// Create template context Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// Task of ApiResponse (TemplateContextResponse) - public async System.Threading.Tasks.Task> CreateTemplateContextAsyncWithHttpInfo (TemplateContextRequest templateRequest) - { - // verify the required parameter 'templateRequest' is set - if (templateRequest == null) - throw new ApiException(400, "Missing required parameter 'templateRequest' when calling AllApi->CreateTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateRequest != null && templateRequest.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(templateRequest); // http body (model) parameter - } - else - { - localVarPostBody = templateRequest; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Delete a stored data set Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// DataSetResponse - public DataSetResponse DeleteDataSet (string dataSetId) - { - ApiResponse localVarResponse = DeleteDataSetWithHttpInfo(dataSetId); - return localVarResponse.Data; - } - - /// - /// Delete a stored data set Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// ApiResponse of DataSetResponse - public ApiResponse< DataSetResponse > DeleteDataSetWithHttpInfo (string dataSetId) - { - // verify the required parameter 'dataSetId' is set - if (dataSetId == null) - throw new ApiException(400, "Missing required parameter 'dataSetId' when calling AllApi->DeleteDataSet"); - - var localVarPath = "/template/processor/0.1/datasets/{dataSetId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (dataSetId != null) localVarPathParams.Add("dataSetId", Configuration.ApiClient.ParameterToString(dataSetId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteDataSet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (DataSetResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DataSetResponse))); - - } - - /// - /// Delete a stored data set Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// Task of DataSetResponse - public async System.Threading.Tasks.Task DeleteDataSetAsync (string dataSetId) - { - ApiResponse localVarResponse = await DeleteDataSetAsyncWithHttpInfo(dataSetId); - return localVarResponse.Data; - - } - - /// - /// Delete a stored data set Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// Task of ApiResponse (DataSetResponse) - public async System.Threading.Tasks.Task> DeleteDataSetAsyncWithHttpInfo (string dataSetId) - { - // verify the required parameter 'dataSetId' is set - if (dataSetId == null) - throw new ApiException(400, "Missing required parameter 'dataSetId' when calling AllApi->DeleteDataSet"); - - var localVarPath = "/template/processor/0.1/datasets/{dataSetId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (dataSetId != null) localVarPathParams.Add("dataSetId", Configuration.ApiClient.ParameterToString(dataSetId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteDataSet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (DataSetResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DataSetResponse))); - - } - - /// - /// Delete a job manually Delete the merge job and all related files - /// - /// Thrown when fails to make API call - /// jobId - /// MergeJobResponse - public MergeJobResponse DeleteJob (string jobId) - { - ApiResponse localVarResponse = DeleteJobWithHttpInfo(jobId); - return localVarResponse.Data; - } - - /// - /// Delete a job manually Delete the merge job and all related files - /// - /// Thrown when fails to make API call - /// jobId - /// ApiResponse of MergeJobResponse - public ApiResponse< MergeJobResponse > DeleteJobWithHttpInfo (string jobId) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling AllApi->DeleteJob"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteJob", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (MergeJobResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(MergeJobResponse))); - - } - - /// - /// Delete a job manually Delete the merge job and all related files - /// - /// Thrown when fails to make API call - /// jobId - /// Task of MergeJobResponse - public async System.Threading.Tasks.Task DeleteJobAsync (string jobId) - { - ApiResponse localVarResponse = await DeleteJobAsyncWithHttpInfo(jobId); - return localVarResponse.Data; - - } - - /// - /// Delete a job manually Delete the merge job and all related files - /// - /// Thrown when fails to make API call - /// jobId - /// Task of ApiResponse (MergeJobResponse) - public async System.Threading.Tasks.Task> DeleteJobAsyncWithHttpInfo (string jobId) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling AllApi->DeleteJob"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteJob", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (MergeJobResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(MergeJobResponse))); - - } - - /// - /// Delete template context Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// TemplateContextResponse - public TemplateContextResponse DeleteTemplateContext (string templateId) - { - ApiResponse localVarResponse = DeleteTemplateContextWithHttpInfo(templateId); - return localVarResponse.Data; - } - - /// - /// Delete template context Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// ApiResponse of TemplateContextResponse - public ApiResponse< TemplateContextResponse > DeleteTemplateContextWithHttpInfo (string templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling AllApi->DeleteTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Delete template context Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// Task of TemplateContextResponse - public async System.Threading.Tasks.Task DeleteTemplateContextAsync (string templateId) - { - ApiResponse localVarResponse = await DeleteTemplateContextAsyncWithHttpInfo(templateId); - return localVarResponse.Data; - - } - - /// - /// Delete template context Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// Task of ApiResponse (TemplateContextResponse) - public async System.Threading.Tasks.Task> DeleteTemplateContextAsyncWithHttpInfo (string templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling AllApi->DeleteTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Job definition and state Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// MergeJobResponse - public MergeJobResponse GetJob (string jobId) - { - ApiResponse localVarResponse = GetJobWithHttpInfo(jobId); - return localVarResponse.Data; - } - - /// - /// Job definition and state Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// ApiResponse of MergeJobResponse - public ApiResponse< MergeJobResponse > GetJobWithHttpInfo (string jobId) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling AllApi->GetJob"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetJob", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (MergeJobResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(MergeJobResponse))); - - } - - /// - /// Job definition and state Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// Task of MergeJobResponse - public async System.Threading.Tasks.Task GetJobAsync (string jobId) - { - ApiResponse localVarResponse = await GetJobAsyncWithHttpInfo(jobId); - return localVarResponse.Data; - - } - - /// - /// Job definition and state Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// Task of ApiResponse (MergeJobResponse) - public async System.Threading.Tasks.Task> GetJobAsyncWithHttpInfo (string jobId) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling AllApi->GetJob"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetJob", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (MergeJobResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(MergeJobResponse))); - - } - - /// - /// Get all jobs Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// List<MergeJobResponse> - public List GetJobs (List status = null) - { - ApiResponse> localVarResponse = GetJobsWithHttpInfo(status); - return localVarResponse.Data; - } - - /// - /// Get all jobs Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// ApiResponse of List<MergeJobResponse> - public ApiResponse< List > GetJobsWithHttpInfo (List status = null) - { - - var localVarPath = "/template/processor/0.1/jobs"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetJobs", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - - } - - /// - /// Get all jobs Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// Task of List<MergeJobResponse> - public async System.Threading.Tasks.Task> GetJobsAsync (List status = null) - { - ApiResponse> localVarResponse = await GetJobsAsyncWithHttpInfo(status); - return localVarResponse.Data; - - } - - /// - /// Get all jobs Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// Task of ApiResponse (List<MergeJobResponse>) - public async System.Threading.Tasks.Task>> GetJobsAsyncWithHttpInfo (List status = null) - { - - var localVarPath = "/template/processor/0.1/jobs"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetJobs", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - - } - - /// - /// Get the result file Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// byte[] - public byte[] GetResultStreamById (string jobId, string streamId, OutputSettings outputSettings = null) - { - ApiResponse localVarResponse = GetResultStreamByIdWithHttpInfo(jobId, streamId, outputSettings); - return localVarResponse.Data; - } - - /// - /// Get the result file Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// ApiResponse of byte[] - public ApiResponse< byte[] > GetResultStreamByIdWithHttpInfo (string jobId, string streamId, OutputSettings outputSettings = null) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling AllApi->GetResultStreamById"); - // verify the required parameter 'streamId' is set - if (streamId == null) - throw new ApiException(400, "Missing required parameter 'streamId' when calling AllApi->GetResultStreamById"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}/result/file/{streamId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/octet-stream" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - if (streamId != null) localVarPathParams.Add("streamId", Configuration.ApiClient.ParameterToString(streamId)); // path parameter - if (outputSettings != null && outputSettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(outputSettings); // http body (model) parameter - } - else - { - localVarPostBody = outputSettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetResultStreamById", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (byte[]) Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); - - } - - /// - /// Get the result file Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// Task of byte[] - public async System.Threading.Tasks.Task GetResultStreamByIdAsync (string jobId, string streamId, OutputSettings outputSettings = null) - { - ApiResponse localVarResponse = await GetResultStreamByIdAsyncWithHttpInfo(jobId, streamId, outputSettings); - return localVarResponse.Data; - - } - - /// - /// Get the result file Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// Task of ApiResponse (byte[]) - public async System.Threading.Tasks.Task> GetResultStreamByIdAsyncWithHttpInfo (string jobId, string streamId, OutputSettings outputSettings = null) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling AllApi->GetResultStreamById"); - // verify the required parameter 'streamId' is set - if (streamId == null) - throw new ApiException(400, "Missing required parameter 'streamId' when calling AllApi->GetResultStreamById"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}/result/file/{streamId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/octet-stream" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - if (streamId != null) localVarPathParams.Add("streamId", Configuration.ApiClient.ParameterToString(streamId)); // path parameter - if (outputSettings != null && outputSettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(outputSettings); // http body (model) parameter - } - else - { - localVarPostBody = outputSettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetResultStreamById", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (byte[]) Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); - - } - - /// - /// Get the result file Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// byte[] - public byte[] GetResultStreamsAsContainer (string jobId, OutputSettings outputSettings = null) - { - ApiResponse localVarResponse = GetResultStreamsAsContainerWithHttpInfo(jobId, outputSettings); - return localVarResponse.Data; - } - - /// - /// Get the result file Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// ApiResponse of byte[] - public ApiResponse< byte[] > GetResultStreamsAsContainerWithHttpInfo (string jobId, OutputSettings outputSettings = null) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling AllApi->GetResultStreamsAsContainer"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}/result/container"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/octet-stream" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - if (outputSettings != null && outputSettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(outputSettings); // http body (model) parameter - } - else - { - localVarPostBody = outputSettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetResultStreamsAsContainer", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (byte[]) Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); - - } - - /// - /// Get the result file Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// Task of byte[] - public async System.Threading.Tasks.Task GetResultStreamsAsContainerAsync (string jobId, OutputSettings outputSettings = null) - { - ApiResponse localVarResponse = await GetResultStreamsAsContainerAsyncWithHttpInfo(jobId, outputSettings); - return localVarResponse.Data; - - } - - /// - /// Get the result file Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// Task of ApiResponse (byte[]) - public async System.Threading.Tasks.Task> GetResultStreamsAsContainerAsyncWithHttpInfo (string jobId, OutputSettings outputSettings = null) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling AllApi->GetResultStreamsAsContainer"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}/result/container"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/octet-stream" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - if (outputSettings != null && outputSettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(outputSettings); // http body (model) parameter - } - else - { - localVarPostBody = outputSettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetResultStreamsAsContainer", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (byte[]) Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); - - } - - /// - /// Get template context Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// TemplateContextResponse - public TemplateContextResponse GetTemplateContext (string templateId) - { - ApiResponse localVarResponse = GetTemplateContextWithHttpInfo(templateId); - return localVarResponse.Data; - } - - /// - /// Get template context Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// ApiResponse of TemplateContextResponse - public ApiResponse< TemplateContextResponse > GetTemplateContextWithHttpInfo (string templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling AllApi->GetTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Get template context Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// Task of TemplateContextResponse - public async System.Threading.Tasks.Task GetTemplateContextAsync (string templateId) - { - ApiResponse localVarResponse = await GetTemplateContextAsyncWithHttpInfo(templateId); - return localVarResponse.Data; - - } - - /// - /// Get template context Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// Task of ApiResponse (TemplateContextResponse) - public async System.Threading.Tasks.Task> GetTemplateContextAsyncWithHttpInfo (string templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling AllApi->GetTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Submit merge job for processing Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// MergeJobResponse - public MergeJobResponse SubmitJob (MergeSettings mergesettings) - { - ApiResponse localVarResponse = SubmitJobWithHttpInfo(mergesettings); - return localVarResponse.Data; - } - - /// - /// Submit merge job for processing Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// ApiResponse of MergeJobResponse - public ApiResponse< MergeJobResponse > SubmitJobWithHttpInfo (MergeSettings mergesettings) - { - // verify the required parameter 'mergesettings' is set - if (mergesettings == null) - throw new ApiException(400, "Missing required parameter 'mergesettings' when calling AllApi->SubmitJob"); - - var localVarPath = "/template/processor/0.1/jobs"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (mergesettings != null && mergesettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(mergesettings); // http body (model) parameter - } - else - { - localVarPostBody = mergesettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SubmitJob", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (MergeJobResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(MergeJobResponse))); - - } - - /// - /// Submit merge job for processing Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// Task of MergeJobResponse - public async System.Threading.Tasks.Task SubmitJobAsync (MergeSettings mergesettings) - { - ApiResponse localVarResponse = await SubmitJobAsyncWithHttpInfo(mergesettings); - return localVarResponse.Data; - - } - - /// - /// Submit merge job for processing Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// Task of ApiResponse (MergeJobResponse) - public async System.Threading.Tasks.Task> SubmitJobAsyncWithHttpInfo (MergeSettings mergesettings) - { - // verify the required parameter 'mergesettings' is set - if (mergesettings == null) - throw new ApiException(400, "Missing required parameter 'mergesettings' when calling AllApi->SubmitJob"); - - var localVarPath = "/template/processor/0.1/jobs"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (mergesettings != null && mergesettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(mergesettings); // http body (model) parameter - } - else - { - localVarPostBody = mergesettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SubmitJob", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (MergeJobResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(MergeJobResponse))); - - } - - /// - /// Update template context Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// TemplateContextResponse - public TemplateContextResponse UpdateTemplateContext (TemplateContextRequest templateContextRequest) - { - ApiResponse localVarResponse = UpdateTemplateContextWithHttpInfo(templateContextRequest); - return localVarResponse.Data; - } - - /// - /// Update template context Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// ApiResponse of TemplateContextResponse - public ApiResponse< TemplateContextResponse > UpdateTemplateContextWithHttpInfo (TemplateContextRequest templateContextRequest) - { - // verify the required parameter 'templateContextRequest' is set - if (templateContextRequest == null) - throw new ApiException(400, "Missing required parameter 'templateContextRequest' when calling AllApi->UpdateTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateContextRequest != null && templateContextRequest.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(templateContextRequest); // http body (model) parameter - } - else - { - localVarPostBody = templateContextRequest; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Update template context Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// Task of TemplateContextResponse - public async System.Threading.Tasks.Task UpdateTemplateContextAsync (TemplateContextRequest templateContextRequest) - { - ApiResponse localVarResponse = await UpdateTemplateContextAsyncWithHttpInfo(templateContextRequest); - return localVarResponse.Data; - - } - - /// - /// Update template context Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// Task of ApiResponse (TemplateContextResponse) - public async System.Threading.Tasks.Task> UpdateTemplateContextAsyncWithHttpInfo (TemplateContextRequest templateContextRequest) - { - // verify the required parameter 'templateContextRequest' is set - if (templateContextRequest == null) - throw new ApiException(400, "Missing required parameter 'templateContextRequest' when calling AllApi->UpdateTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateContextRequest != null && templateContextRequest.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(templateContextRequest); // http body (model) parameter - } - else - { - localVarPostBody = templateContextRequest; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Upload template file Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// TemplateContextResponse - public TemplateContextResponse UploadTemplateFile (string templateId, System.IO.Stream stream) - { - ApiResponse localVarResponse = UploadTemplateFileWithHttpInfo(templateId, stream); - return localVarResponse.Data; - } - - /// - /// Upload template file Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// ApiResponse of TemplateContextResponse - public ApiResponse< TemplateContextResponse > UploadTemplateFileWithHttpInfo (string templateId, System.IO.Stream stream) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling AllApi->UploadTemplateFile"); - // verify the required parameter 'stream' is set - if (stream == null) - throw new ApiException(400, "Missing required parameter 'stream' when calling AllApi->UploadTemplateFile"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "multipart/form-data" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - if (stream != null) localVarFileParams.Add("stream", Configuration.ApiClient.ParameterToFile("stream", stream)); - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UploadTemplateFile", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Upload template file Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// Task of TemplateContextResponse - public async System.Threading.Tasks.Task UploadTemplateFileAsync (string templateId, System.IO.Stream stream) - { - ApiResponse localVarResponse = await UploadTemplateFileAsyncWithHttpInfo(templateId, stream); - return localVarResponse.Data; - - } - - /// - /// Upload template file Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// Task of ApiResponse (TemplateContextResponse) - public async System.Threading.Tasks.Task> UploadTemplateFileAsyncWithHttpInfo (string templateId, System.IO.Stream stream) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling AllApi->UploadTemplateFile"); - // verify the required parameter 'stream' is set - if (stream == null) - throw new ApiException(400, "Missing required parameter 'stream' when calling AllApi->UploadTemplateFile"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "multipart/form-data" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - if (stream != null) localVarFileParams.Add("stream", Configuration.ApiClient.ParameterToFile("stream", stream)); - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UploadTemplateFile", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - } -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/DataSetApi.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/DataSetApi.cs deleted file mode 100644 index 6aa6aa5..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/DataSetApi.cs +++ /dev/null @@ -1,562 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Sphereon.SDK.Template.Processor.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IDataSetApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Store dataset - /// - /// - /// Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// DataSetResponse - DataSetResponse CreateDataSet (string payload); - - /// - /// Store dataset - /// - /// - /// Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// ApiResponse of DataSetResponse - ApiResponse CreateDataSetWithHttpInfo (string payload); - /// - /// Delete a stored data set - /// - /// - /// Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// DataSetResponse - DataSetResponse DeleteDataSet (string dataSetId); - - /// - /// Delete a stored data set - /// - /// - /// Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// ApiResponse of DataSetResponse - ApiResponse DeleteDataSetWithHttpInfo (string dataSetId); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Store dataset - /// - /// - /// Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// Task of DataSetResponse - System.Threading.Tasks.Task CreateDataSetAsync (string payload); - - /// - /// Store dataset - /// - /// - /// Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// Task of ApiResponse (DataSetResponse) - System.Threading.Tasks.Task> CreateDataSetAsyncWithHttpInfo (string payload); - /// - /// Delete a stored data set - /// - /// - /// Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// Task of DataSetResponse - System.Threading.Tasks.Task DeleteDataSetAsync (string dataSetId); - - /// - /// Delete a stored data set - /// - /// - /// Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// Task of ApiResponse (DataSetResponse) - System.Threading.Tasks.Task> DeleteDataSetAsyncWithHttpInfo (string dataSetId); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class DataSetApi : IDataSetApi - { - private Sphereon.SDK.Template.Processor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public DataSetApi(String basePath) - { - this.Configuration = new Configuration(new ApiClient(basePath)); - - ExceptionFactory = Sphereon.SDK.Template.Processor.Client.Configuration.DefaultExceptionFactory; - - // ensure API client has configuration ready - if (Configuration.ApiClient.Configuration == null) - { - this.Configuration.ApiClient.Configuration = this.Configuration; - } - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public DataSetApi(Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = Sphereon.SDK.Template.Processor.Client.Configuration.DefaultExceptionFactory; - - // ensure API client has configuration ready - if (Configuration.ApiClient.Configuration == null) - { - this.Configuration.ApiClient.Configuration = this.Configuration; - } - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public Sphereon.SDK.Template.Processor.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public Dictionary DefaultHeader() - { - return this.Configuration.DefaultHeader; - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Store dataset Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// DataSetResponse - public DataSetResponse CreateDataSet (string payload) - { - ApiResponse localVarResponse = CreateDataSetWithHttpInfo(payload); - return localVarResponse.Data; - } - - /// - /// Store dataset Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// ApiResponse of DataSetResponse - public ApiResponse< DataSetResponse > CreateDataSetWithHttpInfo (string payload) - { - // verify the required parameter 'payload' is set - if (payload == null) - throw new ApiException(400, "Missing required parameter 'payload' when calling DataSetApi->CreateDataSet"); - - var localVarPath = "/template/processor/0.1/datasets"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (payload != null && payload.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(payload); // http body (model) parameter - } - else - { - localVarPostBody = payload; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateDataSet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (DataSetResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DataSetResponse))); - - } - - /// - /// Store dataset Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// Task of DataSetResponse - public async System.Threading.Tasks.Task CreateDataSetAsync (string payload) - { - ApiResponse localVarResponse = await CreateDataSetAsyncWithHttpInfo(payload); - return localVarResponse.Data; - - } - - /// - /// Store dataset Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - /// - /// Thrown when fails to make API call - /// The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] - /// Task of ApiResponse (DataSetResponse) - public async System.Threading.Tasks.Task> CreateDataSetAsyncWithHttpInfo (string payload) - { - // verify the required parameter 'payload' is set - if (payload == null) - throw new ApiException(400, "Missing required parameter 'payload' when calling DataSetApi->CreateDataSet"); - - var localVarPath = "/template/processor/0.1/datasets"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (payload != null && payload.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(payload); // http body (model) parameter - } - else - { - localVarPostBody = payload; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateDataSet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (DataSetResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DataSetResponse))); - - } - - /// - /// Delete a stored data set Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// DataSetResponse - public DataSetResponse DeleteDataSet (string dataSetId) - { - ApiResponse localVarResponse = DeleteDataSetWithHttpInfo(dataSetId); - return localVarResponse.Data; - } - - /// - /// Delete a stored data set Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// ApiResponse of DataSetResponse - public ApiResponse< DataSetResponse > DeleteDataSetWithHttpInfo (string dataSetId) - { - // verify the required parameter 'dataSetId' is set - if (dataSetId == null) - throw new ApiException(400, "Missing required parameter 'dataSetId' when calling DataSetApi->DeleteDataSet"); - - var localVarPath = "/template/processor/0.1/datasets/{dataSetId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (dataSetId != null) localVarPathParams.Add("dataSetId", Configuration.ApiClient.ParameterToString(dataSetId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteDataSet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (DataSetResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DataSetResponse))); - - } - - /// - /// Delete a stored data set Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// Task of DataSetResponse - public async System.Threading.Tasks.Task DeleteDataSetAsync (string dataSetId) - { - ApiResponse localVarResponse = await DeleteDataSetAsyncWithHttpInfo(dataSetId); - return localVarResponse.Data; - - } - - /// - /// Delete a stored data set Delete a stored data set - /// - /// Thrown when fails to make API call - /// dataSetId - /// Task of ApiResponse (DataSetResponse) - public async System.Threading.Tasks.Task> DeleteDataSetAsyncWithHttpInfo (string dataSetId) - { - // verify the required parameter 'dataSetId' is set - if (dataSetId == null) - throw new ApiException(400, "Missing required parameter 'dataSetId' when calling DataSetApi->DeleteDataSet"); - - var localVarPath = "/template/processor/0.1/datasets/{dataSetId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (dataSetId != null) localVarPathParams.Add("dataSetId", Configuration.ApiClient.ParameterToString(dataSetId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteDataSet", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (DataSetResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DataSetResponse))); - - } - - } -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/JobApi.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/JobApi.cs deleted file mode 100644 index bc8c0b7..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/JobApi.cs +++ /dev/null @@ -1,1211 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Sphereon.SDK.Template.Processor.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface IJobApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Job definition and state - /// - /// - /// Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// MergeJobResponse - MergeJobResponse GetJob (string jobId); - - /// - /// Job definition and state - /// - /// - /// Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// ApiResponse of MergeJobResponse - ApiResponse GetJobWithHttpInfo (string jobId); - /// - /// Get all jobs - /// - /// - /// Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// List<MergeJobResponse> - List GetJobs (List status = null); - - /// - /// Get all jobs - /// - /// - /// Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// ApiResponse of List<MergeJobResponse> - ApiResponse> GetJobsWithHttpInfo (List status = null); - /// - /// Get the result file - /// - /// - /// Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// byte[] - byte[] GetResultStreamById (string jobId, string streamId, OutputSettings outputSettings = null); - - /// - /// Get the result file - /// - /// - /// Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// ApiResponse of byte[] - ApiResponse GetResultStreamByIdWithHttpInfo (string jobId, string streamId, OutputSettings outputSettings = null); - /// - /// Get the result file - /// - /// - /// Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// byte[] - byte[] GetResultStreamsAsContainer (string jobId, OutputSettings outputSettings = null); - - /// - /// Get the result file - /// - /// - /// Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// ApiResponse of byte[] - ApiResponse GetResultStreamsAsContainerWithHttpInfo (string jobId, OutputSettings outputSettings = null); - /// - /// Submit merge job for processing - /// - /// - /// Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// MergeJobResponse - MergeJobResponse SubmitJob (MergeSettings mergesettings); - - /// - /// Submit merge job for processing - /// - /// - /// Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// ApiResponse of MergeJobResponse - ApiResponse SubmitJobWithHttpInfo (MergeSettings mergesettings); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Job definition and state - /// - /// - /// Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// Task of MergeJobResponse - System.Threading.Tasks.Task GetJobAsync (string jobId); - - /// - /// Job definition and state - /// - /// - /// Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// Task of ApiResponse (MergeJobResponse) - System.Threading.Tasks.Task> GetJobAsyncWithHttpInfo (string jobId); - /// - /// Get all jobs - /// - /// - /// Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// Task of List<MergeJobResponse> - System.Threading.Tasks.Task> GetJobsAsync (List status = null); - - /// - /// Get all jobs - /// - /// - /// Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// Task of ApiResponse (List<MergeJobResponse>) - System.Threading.Tasks.Task>> GetJobsAsyncWithHttpInfo (List status = null); - /// - /// Get the result file - /// - /// - /// Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// Task of byte[] - System.Threading.Tasks.Task GetResultStreamByIdAsync (string jobId, string streamId, OutputSettings outputSettings = null); - - /// - /// Get the result file - /// - /// - /// Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// Task of ApiResponse (byte[]) - System.Threading.Tasks.Task> GetResultStreamByIdAsyncWithHttpInfo (string jobId, string streamId, OutputSettings outputSettings = null); - /// - /// Get the result file - /// - /// - /// Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// Task of byte[] - System.Threading.Tasks.Task GetResultStreamsAsContainerAsync (string jobId, OutputSettings outputSettings = null); - - /// - /// Get the result file - /// - /// - /// Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// Task of ApiResponse (byte[]) - System.Threading.Tasks.Task> GetResultStreamsAsContainerAsyncWithHttpInfo (string jobId, OutputSettings outputSettings = null); - /// - /// Submit merge job for processing - /// - /// - /// Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// Task of MergeJobResponse - System.Threading.Tasks.Task SubmitJobAsync (MergeSettings mergesettings); - - /// - /// Submit merge job for processing - /// - /// - /// Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// Task of ApiResponse (MergeJobResponse) - System.Threading.Tasks.Task> SubmitJobAsyncWithHttpInfo (MergeSettings mergesettings); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class JobApi : IJobApi - { - private Sphereon.SDK.Template.Processor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public JobApi(String basePath) - { - this.Configuration = new Configuration(new ApiClient(basePath)); - - ExceptionFactory = Sphereon.SDK.Template.Processor.Client.Configuration.DefaultExceptionFactory; - - // ensure API client has configuration ready - if (Configuration.ApiClient.Configuration == null) - { - this.Configuration.ApiClient.Configuration = this.Configuration; - } - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public JobApi(Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = Sphereon.SDK.Template.Processor.Client.Configuration.DefaultExceptionFactory; - - // ensure API client has configuration ready - if (Configuration.ApiClient.Configuration == null) - { - this.Configuration.ApiClient.Configuration = this.Configuration; - } - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public Sphereon.SDK.Template.Processor.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public Dictionary DefaultHeader() - { - return this.Configuration.DefaultHeader; - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Job definition and state Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// MergeJobResponse - public MergeJobResponse GetJob (string jobId) - { - ApiResponse localVarResponse = GetJobWithHttpInfo(jobId); - return localVarResponse.Data; - } - - /// - /// Job definition and state Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// ApiResponse of MergeJobResponse - public ApiResponse< MergeJobResponse > GetJobWithHttpInfo (string jobId) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling JobApi->GetJob"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetJob", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (MergeJobResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(MergeJobResponse))); - - } - - /// - /// Job definition and state Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// Task of MergeJobResponse - public async System.Threading.Tasks.Task GetJobAsync (string jobId) - { - ApiResponse localVarResponse = await GetJobAsyncWithHttpInfo(jobId); - return localVarResponse.Data; - - } - - /// - /// Job definition and state Get the merge job definition and current state. Please not that you can differentiate based on http response status - /// - /// Thrown when fails to make API call - /// jobId - /// Task of ApiResponse (MergeJobResponse) - public async System.Threading.Tasks.Task> GetJobAsyncWithHttpInfo (string jobId) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling JobApi->GetJob"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetJob", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (MergeJobResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(MergeJobResponse))); - - } - - /// - /// Get all jobs Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// List<MergeJobResponse> - public List GetJobs (List status = null) - { - ApiResponse> localVarResponse = GetJobsWithHttpInfo(status); - return localVarResponse.Data; - } - - /// - /// Get all jobs Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// ApiResponse of List<MergeJobResponse> - public ApiResponse< List > GetJobsWithHttpInfo (List status = null) - { - - var localVarPath = "/template/processor/0.1/jobs"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetJobs", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - - } - - /// - /// Get all jobs Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// Task of List<MergeJobResponse> - public async System.Threading.Tasks.Task> GetJobsAsync (List status = null) - { - ApiResponse> localVarResponse = await GetJobsAsyncWithHttpInfo(status); - return localVarResponse.Data; - - } - - /// - /// Get all jobs Get all office text job definitions and their current state. - /// - /// Thrown when fails to make API call - /// A list of status to filter on. (optional) - /// Task of ApiResponse (List<MergeJobResponse>) - public async System.Threading.Tasks.Task>> GetJobsAsyncWithHttpInfo (List status = null) - { - - var localVarPath = "/template/processor/0.1/jobs"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetJobs", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - - } - - /// - /// Get the result file Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// byte[] - public byte[] GetResultStreamById (string jobId, string streamId, OutputSettings outputSettings = null) - { - ApiResponse localVarResponse = GetResultStreamByIdWithHttpInfo(jobId, streamId, outputSettings); - return localVarResponse.Data; - } - - /// - /// Get the result file Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// ApiResponse of byte[] - public ApiResponse< byte[] > GetResultStreamByIdWithHttpInfo (string jobId, string streamId, OutputSettings outputSettings = null) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling JobApi->GetResultStreamById"); - // verify the required parameter 'streamId' is set - if (streamId == null) - throw new ApiException(400, "Missing required parameter 'streamId' when calling JobApi->GetResultStreamById"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}/result/file/{streamId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/octet-stream" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - if (streamId != null) localVarPathParams.Add("streamId", Configuration.ApiClient.ParameterToString(streamId)); // path parameter - if (outputSettings != null && outputSettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(outputSettings); // http body (model) parameter - } - else - { - localVarPostBody = outputSettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetResultStreamById", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (byte[]) Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); - - } - - /// - /// Get the result file Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// Task of byte[] - public async System.Threading.Tasks.Task GetResultStreamByIdAsync (string jobId, string streamId, OutputSettings outputSettings = null) - { - ApiResponse localVarResponse = await GetResultStreamByIdAsyncWithHttpInfo(jobId, streamId, outputSettings); - return localVarResponse.Data; - - } - - /// - /// Get the result file Get a merge result document as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// streamId - /// outputSettings (optional) - /// Task of ApiResponse (byte[]) - public async System.Threading.Tasks.Task> GetResultStreamByIdAsyncWithHttpInfo (string jobId, string streamId, OutputSettings outputSettings = null) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling JobApi->GetResultStreamById"); - // verify the required parameter 'streamId' is set - if (streamId == null) - throw new ApiException(400, "Missing required parameter 'streamId' when calling JobApi->GetResultStreamById"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}/result/file/{streamId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/octet-stream" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - if (streamId != null) localVarPathParams.Add("streamId", Configuration.ApiClient.ParameterToString(streamId)); // path parameter - if (outputSettings != null && outputSettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(outputSettings); // http body (model) parameter - } - else - { - localVarPostBody = outputSettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetResultStreamById", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (byte[]) Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); - - } - - /// - /// Get the result file Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// byte[] - public byte[] GetResultStreamsAsContainer (string jobId, OutputSettings outputSettings = null) - { - ApiResponse localVarResponse = GetResultStreamsAsContainerWithHttpInfo(jobId, outputSettings); - return localVarResponse.Data; - } - - /// - /// Get the result file Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// ApiResponse of byte[] - public ApiResponse< byte[] > GetResultStreamsAsContainerWithHttpInfo (string jobId, OutputSettings outputSettings = null) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling JobApi->GetResultStreamsAsContainer"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}/result/container"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/octet-stream" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - if (outputSettings != null && outputSettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(outputSettings); // http body (model) parameter - } - else - { - localVarPostBody = outputSettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetResultStreamsAsContainer", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (byte[]) Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); - - } - - /// - /// Get the result file Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// Task of byte[] - public async System.Threading.Tasks.Task GetResultStreamsAsContainerAsync (string jobId, OutputSettings outputSettings = null) - { - ApiResponse localVarResponse = await GetResultStreamsAsContainerAsyncWithHttpInfo(jobId, outputSettings); - return localVarResponse.Data; - - } - - /// - /// Get the result file Get all documents inside a compressed container as a binary stream. - /// - /// Thrown when fails to make API call - /// jobId - /// outputSettings (optional) - /// Task of ApiResponse (byte[]) - public async System.Threading.Tasks.Task> GetResultStreamsAsContainerAsyncWithHttpInfo (string jobId, OutputSettings outputSettings = null) - { - // verify the required parameter 'jobId' is set - if (jobId == null) - throw new ApiException(400, "Missing required parameter 'jobId' when calling JobApi->GetResultStreamsAsContainer"); - - var localVarPath = "/template/processor/0.1/jobs/{jobId}/result/container"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/octet-stream" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (jobId != null) localVarPathParams.Add("jobId", Configuration.ApiClient.ParameterToString(jobId)); // path parameter - if (outputSettings != null && outputSettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(outputSettings); // http body (model) parameter - } - else - { - localVarPostBody = outputSettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetResultStreamsAsContainer", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (byte[]) Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); - - } - - /// - /// Submit merge job for processing Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// MergeJobResponse - public MergeJobResponse SubmitJob (MergeSettings mergesettings) - { - ApiResponse localVarResponse = SubmitJobWithHttpInfo(mergesettings); - return localVarResponse.Data; - } - - /// - /// Submit merge job for processing Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// ApiResponse of MergeJobResponse - public ApiResponse< MergeJobResponse > SubmitJobWithHttpInfo (MergeSettings mergesettings) - { - // verify the required parameter 'mergesettings' is set - if (mergesettings == null) - throw new ApiException(400, "Missing required parameter 'mergesettings' when calling JobApi->SubmitJob"); - - var localVarPath = "/template/processor/0.1/jobs"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (mergesettings != null && mergesettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(mergesettings); // http body (model) parameter - } - else - { - localVarPostBody = mergesettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SubmitJob", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (MergeJobResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(MergeJobResponse))); - - } - - /// - /// Submit merge job for processing Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// Task of MergeJobResponse - public async System.Threading.Tasks.Task SubmitJobAsync (MergeSettings mergesettings) - { - ApiResponse localVarResponse = await SubmitJobAsyncWithHttpInfo(mergesettings); - return localVarResponse.Data; - - } - - /// - /// Submit merge job for processing Submit merge job run. - /// - /// Thrown when fails to make API call - /// The merge- and output settings - /// Task of ApiResponse (MergeJobResponse) - public async System.Threading.Tasks.Task> SubmitJobAsyncWithHttpInfo (MergeSettings mergesettings) - { - // verify the required parameter 'mergesettings' is set - if (mergesettings == null) - throw new ApiException(400, "Missing required parameter 'mergesettings' when calling JobApi->SubmitJob"); - - var localVarPath = "/template/processor/0.1/jobs"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (mergesettings != null && mergesettings.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(mergesettings); // http body (model) parameter - } - else - { - localVarPostBody = mergesettings; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("SubmitJob", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (MergeJobResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(MergeJobResponse))); - - } - - } -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/TemplateApi.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/TemplateApi.cs deleted file mode 100644 index 6129b7f..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Api/TemplateApi.cs +++ /dev/null @@ -1,1183 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp; -using Sphereon.SDK.Template.Processor.Client; -using Sphereon.SDK.Template.Processor.Model; - -namespace Sphereon.SDK.Template.Processor.Api -{ - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public interface ITemplateApi : IApiAccessor - { - #region Synchronous Operations - /// - /// Create template context - /// - /// - /// Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// TemplateContextResponse - TemplateContextResponse CreateTemplateContext (TemplateContextRequest templateRequest); - - /// - /// Create template context - /// - /// - /// Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// ApiResponse of TemplateContextResponse - ApiResponse CreateTemplateContextWithHttpInfo (TemplateContextRequest templateRequest); - /// - /// Delete template context - /// - /// - /// Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// TemplateContextResponse - TemplateContextResponse DeleteTemplateContext (string templateId); - - /// - /// Delete template context - /// - /// - /// Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// ApiResponse of TemplateContextResponse - ApiResponse DeleteTemplateContextWithHttpInfo (string templateId); - /// - /// Get template context - /// - /// - /// Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// TemplateContextResponse - TemplateContextResponse GetTemplateContext (string templateId); - - /// - /// Get template context - /// - /// - /// Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// ApiResponse of TemplateContextResponse - ApiResponse GetTemplateContextWithHttpInfo (string templateId); - /// - /// Update template context - /// - /// - /// Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// TemplateContextResponse - TemplateContextResponse UpdateTemplateContext (TemplateContextRequest templateContextRequest); - - /// - /// Update template context - /// - /// - /// Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// ApiResponse of TemplateContextResponse - ApiResponse UpdateTemplateContextWithHttpInfo (TemplateContextRequest templateContextRequest); - /// - /// Upload template file - /// - /// - /// Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// TemplateContextResponse - TemplateContextResponse UploadTemplateFile (string templateId, System.IO.Stream stream); - - /// - /// Upload template file - /// - /// - /// Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// ApiResponse of TemplateContextResponse - ApiResponse UploadTemplateFileWithHttpInfo (string templateId, System.IO.Stream stream); - #endregion Synchronous Operations - #region Asynchronous Operations - /// - /// Create template context - /// - /// - /// Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// Task of TemplateContextResponse - System.Threading.Tasks.Task CreateTemplateContextAsync (TemplateContextRequest templateRequest); - - /// - /// Create template context - /// - /// - /// Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// Task of ApiResponse (TemplateContextResponse) - System.Threading.Tasks.Task> CreateTemplateContextAsyncWithHttpInfo (TemplateContextRequest templateRequest); - /// - /// Delete template context - /// - /// - /// Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// Task of TemplateContextResponse - System.Threading.Tasks.Task DeleteTemplateContextAsync (string templateId); - - /// - /// Delete template context - /// - /// - /// Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// Task of ApiResponse (TemplateContextResponse) - System.Threading.Tasks.Task> DeleteTemplateContextAsyncWithHttpInfo (string templateId); - /// - /// Get template context - /// - /// - /// Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// Task of TemplateContextResponse - System.Threading.Tasks.Task GetTemplateContextAsync (string templateId); - - /// - /// Get template context - /// - /// - /// Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// Task of ApiResponse (TemplateContextResponse) - System.Threading.Tasks.Task> GetTemplateContextAsyncWithHttpInfo (string templateId); - /// - /// Update template context - /// - /// - /// Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// Task of TemplateContextResponse - System.Threading.Tasks.Task UpdateTemplateContextAsync (TemplateContextRequest templateContextRequest); - - /// - /// Update template context - /// - /// - /// Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// Task of ApiResponse (TemplateContextResponse) - System.Threading.Tasks.Task> UpdateTemplateContextAsyncWithHttpInfo (TemplateContextRequest templateContextRequest); - /// - /// Upload template file - /// - /// - /// Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// Task of TemplateContextResponse - System.Threading.Tasks.Task UploadTemplateFileAsync (string templateId, System.IO.Stream stream); - - /// - /// Upload template file - /// - /// - /// Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// Task of ApiResponse (TemplateContextResponse) - System.Threading.Tasks.Task> UploadTemplateFileAsyncWithHttpInfo (string templateId, System.IO.Stream stream); - #endregion Asynchronous Operations - } - - /// - /// Represents a collection of functions to interact with the API endpoints - /// - public partial class TemplateApi : ITemplateApi - { - private Sphereon.SDK.Template.Processor.Client.ExceptionFactory _exceptionFactory = (name, response) => null; - - /// - /// Initializes a new instance of the class. - /// - /// - public TemplateApi(String basePath) - { - this.Configuration = new Configuration(new ApiClient(basePath)); - - ExceptionFactory = Sphereon.SDK.Template.Processor.Client.Configuration.DefaultExceptionFactory; - - // ensure API client has configuration ready - if (Configuration.ApiClient.Configuration == null) - { - this.Configuration.ApiClient.Configuration = this.Configuration; - } - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public TemplateApi(Configuration configuration = null) - { - if (configuration == null) // use the default one in Configuration - this.Configuration = Configuration.Default; - else - this.Configuration = configuration; - - ExceptionFactory = Sphereon.SDK.Template.Processor.Client.Configuration.DefaultExceptionFactory; - - // ensure API client has configuration ready - if (Configuration.ApiClient.Configuration == null) - { - this.Configuration.ApiClient.Configuration = this.Configuration; - } - } - - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - - /// - /// Sets the base path of the API client. - /// - /// The base path - [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] - public void SetBasePath(String basePath) - { - // do nothing - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public Configuration Configuration {get; set;} - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public Sphereon.SDK.Template.Processor.Client.ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - - /// - /// Gets the default header. - /// - /// Dictionary of HTTP header - [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] - public Dictionary DefaultHeader() - { - return this.Configuration.DefaultHeader; - } - - /// - /// Add default header. - /// - /// Header field name. - /// Header field value. - /// - [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] - public void AddDefaultHeader(string key, string value) - { - this.Configuration.AddDefaultHeader(key, value); - } - - /// - /// Create template context Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// TemplateContextResponse - public TemplateContextResponse CreateTemplateContext (TemplateContextRequest templateRequest) - { - ApiResponse localVarResponse = CreateTemplateContextWithHttpInfo(templateRequest); - return localVarResponse.Data; - } - - /// - /// Create template context Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// ApiResponse of TemplateContextResponse - public ApiResponse< TemplateContextResponse > CreateTemplateContextWithHttpInfo (TemplateContextRequest templateRequest) - { - // verify the required parameter 'templateRequest' is set - if (templateRequest == null) - throw new ApiException(400, "Missing required parameter 'templateRequest' when calling TemplateApi->CreateTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateRequest != null && templateRequest.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(templateRequest); // http body (model) parameter - } - else - { - localVarPostBody = templateRequest; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Create template context Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// Task of TemplateContextResponse - public async System.Threading.Tasks.Task CreateTemplateContextAsync (TemplateContextRequest templateRequest) - { - ApiResponse localVarResponse = await CreateTemplateContextAsyncWithHttpInfo(templateRequest); - return localVarResponse.Data; - - } - - /// - /// Create template context Create a unique template context for your environment - /// - /// Thrown when fails to make API call - /// The template request - /// Task of ApiResponse (TemplateContextResponse) - public async System.Threading.Tasks.Task> CreateTemplateContextAsyncWithHttpInfo (TemplateContextRequest templateRequest) - { - // verify the required parameter 'templateRequest' is set - if (templateRequest == null) - throw new ApiException(400, "Missing required parameter 'templateRequest' when calling TemplateApi->CreateTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateRequest != null && templateRequest.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(templateRequest); // http body (model) parameter - } - else - { - localVarPostBody = templateRequest; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("CreateTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Delete template context Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// TemplateContextResponse - public TemplateContextResponse DeleteTemplateContext (string templateId) - { - ApiResponse localVarResponse = DeleteTemplateContextWithHttpInfo(templateId); - return localVarResponse.Data; - } - - /// - /// Delete template context Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// ApiResponse of TemplateContextResponse - public ApiResponse< TemplateContextResponse > DeleteTemplateContextWithHttpInfo (string templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TemplateApi->DeleteTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Delete template context Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// Task of TemplateContextResponse - public async System.Threading.Tasks.Task DeleteTemplateContextAsync (string templateId) - { - ApiResponse localVarResponse = await DeleteTemplateContextAsyncWithHttpInfo(templateId); - return localVarResponse.Data; - - } - - /// - /// Delete template context Delete a template context with all history - /// - /// Thrown when fails to make API call - /// templateId - /// Task of ApiResponse (TemplateContextResponse) - public async System.Threading.Tasks.Task> DeleteTemplateContextAsyncWithHttpInfo (string templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TemplateApi->DeleteTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("DeleteTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Get template context Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// TemplateContextResponse - public TemplateContextResponse GetTemplateContext (string templateId) - { - ApiResponse localVarResponse = GetTemplateContextWithHttpInfo(templateId); - return localVarResponse.Data; - } - - /// - /// Get template context Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// ApiResponse of TemplateContextResponse - public ApiResponse< TemplateContextResponse > GetTemplateContextWithHttpInfo (string templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TemplateApi->GetTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Get template context Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// Task of TemplateContextResponse - public async System.Threading.Tasks.Task GetTemplateContextAsync (string templateId) - { - ApiResponse localVarResponse = await GetTemplateContextAsyncWithHttpInfo(templateId); - return localVarResponse.Data; - - } - - /// - /// Get template context Get an existing template context - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// Task of ApiResponse (TemplateContextResponse) - public async System.Threading.Tasks.Task> GetTemplateContextAsyncWithHttpInfo (string templateId) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TemplateApi->GetTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("GetTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Update template context Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// TemplateContextResponse - public TemplateContextResponse UpdateTemplateContext (TemplateContextRequest templateContextRequest) - { - ApiResponse localVarResponse = UpdateTemplateContextWithHttpInfo(templateContextRequest); - return localVarResponse.Data; - } - - /// - /// Update template context Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// ApiResponse of TemplateContextResponse - public ApiResponse< TemplateContextResponse > UpdateTemplateContextWithHttpInfo (TemplateContextRequest templateContextRequest) - { - // verify the required parameter 'templateContextRequest' is set - if (templateContextRequest == null) - throw new ApiException(400, "Missing required parameter 'templateContextRequest' when calling TemplateApi->UpdateTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateContextRequest != null && templateContextRequest.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(templateContextRequest); // http body (model) parameter - } - else - { - localVarPostBody = templateContextRequest; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Update template context Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// Task of TemplateContextResponse - public async System.Threading.Tasks.Task UpdateTemplateContextAsync (TemplateContextRequest templateContextRequest) - { - ApiResponse localVarResponse = await UpdateTemplateContextAsyncWithHttpInfo(templateContextRequest); - return localVarResponse.Data; - - } - - /// - /// Update template context Update an existing template context for your environment - /// - /// Thrown when fails to make API call - /// templateContextRequest - /// Task of ApiResponse (TemplateContextResponse) - public async System.Threading.Tasks.Task> UpdateTemplateContextAsyncWithHttpInfo (TemplateContextRequest templateContextRequest) - { - // verify the required parameter 'templateContextRequest' is set - if (templateContextRequest == null) - throw new ApiException(400, "Missing required parameter 'templateContextRequest' when calling TemplateApi->UpdateTemplateContext"); - - var localVarPath = "/template/processor/0.1/templates"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateContextRequest != null && templateContextRequest.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(templateContextRequest); // http body (model) parameter - } - else - { - localVarPostBody = templateContextRequest; // byte array - } - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UpdateTemplateContext", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Upload template file Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// TemplateContextResponse - public TemplateContextResponse UploadTemplateFile (string templateId, System.IO.Stream stream) - { - ApiResponse localVarResponse = UploadTemplateFileWithHttpInfo(templateId, stream); - return localVarResponse.Data; - } - - /// - /// Upload template file Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// ApiResponse of TemplateContextResponse - public ApiResponse< TemplateContextResponse > UploadTemplateFileWithHttpInfo (string templateId, System.IO.Stream stream) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TemplateApi->UploadTemplateFile"); - // verify the required parameter 'stream' is set - if (stream == null) - throw new ApiException(400, "Missing required parameter 'stream' when calling TemplateApi->UploadTemplateFile"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "multipart/form-data" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - if (stream != null) localVarFileParams.Add("stream", Configuration.ApiClient.ParameterToFile("stream", stream)); - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UploadTemplateFile", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - /// - /// Upload template file Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// Task of TemplateContextResponse - public async System.Threading.Tasks.Task UploadTemplateFileAsync (string templateId, System.IO.Stream stream) - { - ApiResponse localVarResponse = await UploadTemplateFileAsyncWithHttpInfo(templateId, stream); - return localVarResponse.Data; - - } - - /// - /// Upload template file Upload the Office template file - /// - /// Thrown when fails to make API call - /// The template context name unique for your environment - /// The template (file/inputstream) to store - /// Task of ApiResponse (TemplateContextResponse) - public async System.Threading.Tasks.Task> UploadTemplateFileAsyncWithHttpInfo (string templateId, System.IO.Stream stream) - { - // verify the required parameter 'templateId' is set - if (templateId == null) - throw new ApiException(400, "Missing required parameter 'templateId' when calling TemplateApi->UploadTemplateFile"); - // verify the required parameter 'stream' is set - if (stream == null) - throw new ApiException(400, "Missing required parameter 'stream' when calling TemplateApi->UploadTemplateFile"); - - var localVarPath = "/template/processor/0.1/templates/{templateId}"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "multipart/form-data" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json;charset=UTF-8" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (templateId != null) localVarPathParams.Add("templateId", Configuration.ApiClient.ParameterToString(templateId)); // path parameter - if (stream != null) localVarFileParams.Add("stream", Configuration.ApiClient.ParameterToFile("stream", stream)); - - // authentication (oauth2schema) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory("UploadTemplateFile", localVarResponse); - if (exception != null) throw exception; - } - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (TemplateContextResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TemplateContextResponse))); - - } - - } -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ExceptionFactory.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ExceptionFactory.cs deleted file mode 100644 index f36c758..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ExceptionFactory.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -using System; -using RestSharp; - -namespace Sphereon.SDK.Template.Processor.Client -{ - /// - /// A delegate to ExceptionFactory method - /// - /// Method name - /// Response - /// Exceptions - public delegate Exception ExceptionFactory(string methodName, IRestResponse response); -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/IApiAccessor.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/IApiAccessor.cs deleted file mode 100644 index 7694733..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/IApiAccessor.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp; - -namespace Sphereon.SDK.Template.Processor.Client -{ - /// - /// Represents configuration aspects required to interact with the API endpoints. - /// - public interface IApiAccessor - { - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - Configuration Configuration {get; set;} - - /// - /// Gets the base path of the API client. - /// - /// The base path - String GetBasePath(); - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - ExceptionFactory ExceptionFactory { get; set; } - } -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/DataSetResponse.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/DataSetResponse.cs deleted file mode 100644 index 1cf941d..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/DataSetResponse.cs +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// The merge template response. - /// - [DataContract] - public partial class DataSetResponse : IEquatable - { - /// - /// The status of the template - /// - /// The status of the template - [JsonConverter(typeof(StringEnumConverter))] - public enum StatusEnum - { - - /// - /// Enum CREATED for "CREATED" - /// - [EnumMember(Value = "CREATED")] - CREATED, - - /// - /// Enum UPDATED for "UPDATED" - /// - [EnumMember(Value = "UPDATED")] - UPDATED, - - /// - /// Enum DELETED for "DELETED" - /// - [EnumMember(Value = "DELETED")] - DELETED - } - - /// - /// The status of the template - /// - /// The status of the template - [DataMember(Name="status", EmitDefaultValue=false)] - public StatusEnum? Status { get; set; } - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected DataSetResponse() { } - /// - /// Initializes a new instance of the class. - /// - /// Unique dataset id (required). - public DataSetResponse(string Id = null) - { - // to ensure "Id" is required (not null) - if (Id == null) - { - throw new InvalidDataException("Id is a required property for DataSetResponse and cannot be null"); - } - else - { - this.Id = Id; - } - } - - /// - /// The completion date/time of this template in ISO 8601 format - /// - /// The completion date/time of this template in ISO 8601 format - [DataMember(Name="completionTime", EmitDefaultValue=false)] - public DateTime? CompletionTime { get; private set; } - /// - /// The creation date/time of this template in ISO 8601 format - /// - /// The creation date/time of this template in ISO 8601 format - [DataMember(Name="creationTime", EmitDefaultValue=false)] - public DateTime? CreationTime { get; private set; } - /// - /// Unique dataset id - /// - /// Unique dataset id - [DataMember(Name="id", EmitDefaultValue=false)] - public string Id { get; set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class DataSetResponse {\n"); - sb.Append(" CompletionTime: ").Append(CompletionTime).Append("\n"); - sb.Append(" CreationTime: ").Append(CreationTime).Append("\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as DataSetResponse); - } - - /// - /// Returns true if DataSetResponse instances are equal - /// - /// Instance of DataSetResponse to be compared - /// Boolean - public bool Equals(DataSetResponse other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.CompletionTime == other.CompletionTime || - this.CompletionTime != null && - this.CompletionTime.Equals(other.CompletionTime) - ) && - ( - this.CreationTime == other.CreationTime || - this.CreationTime != null && - this.CreationTime.Equals(other.CreationTime) - ) && - ( - this.Id == other.Id || - this.Id != null && - this.Id.Equals(other.Id) - ) && - ( - this.Status == other.Status || - this.Status != null && - this.Status.Equals(other.Status) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.CompletionTime != null) - hash = hash * 59 + this.CompletionTime.GetHashCode(); - if (this.CreationTime != null) - hash = hash * 59 + this.CreationTime.GetHashCode(); - if (this.Id != null) - hash = hash * 59 + this.Id.GetHashCode(); - if (this.Status != null) - hash = hash * 59 + this.Status.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/Error.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/Error.cs deleted file mode 100644 index 0085ba9..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/Error.cs +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// An error - /// - [DataContract] - public partial class Error : IEquatable - { - /// - /// Gets or Sets Level - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum LevelEnum - { - - /// - /// Enum INFO for "INFO" - /// - [EnumMember(Value = "INFO")] - INFO, - - /// - /// Enum WARNING for "WARNING" - /// - [EnumMember(Value = "WARNING")] - WARNING, - - /// - /// Enum FATAL for "FATAL" - /// - [EnumMember(Value = "FATAL")] - FATAL - } - - /// - /// Gets or Sets Level - /// - [DataMember(Name="level", EmitDefaultValue=false)] - public LevelEnum? Level { get; set; } - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected Error() { } - /// - /// Initializes a new instance of the class. - /// - /// Code (required). - /// Level (required). - /// Cause. - /// Message (required). - public Error(string Code = null, LevelEnum? Level = null, Error Cause = null, string Message = null) - { - // to ensure "Code" is required (not null) - if (Code == null) - { - throw new InvalidDataException("Code is a required property for Error and cannot be null"); - } - else - { - this.Code = Code; - } - // to ensure "Level" is required (not null) - if (Level == null) - { - throw new InvalidDataException("Level is a required property for Error and cannot be null"); - } - else - { - this.Level = Level; - } - // to ensure "Message" is required (not null) - if (Message == null) - { - throw new InvalidDataException("Message is a required property for Error and cannot be null"); - } - else - { - this.Message = Message; - } - this.Cause = Cause; - } - - /// - /// Gets or Sets Code - /// - [DataMember(Name="code", EmitDefaultValue=false)] - public string Code { get; set; } - /// - /// Gets or Sets Cause - /// - [DataMember(Name="cause", EmitDefaultValue=false)] - public Error Cause { get; set; } - /// - /// Gets or Sets Message - /// - [DataMember(Name="message", EmitDefaultValue=false)] - public string Message { get; set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Error {\n"); - sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Level: ").Append(Level).Append("\n"); - sb.Append(" Cause: ").Append(Cause).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as Error); - } - - /// - /// Returns true if Error instances are equal - /// - /// Instance of Error to be compared - /// Boolean - public bool Equals(Error other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.Code == other.Code || - this.Code != null && - this.Code.Equals(other.Code) - ) && - ( - this.Level == other.Level || - this.Level != null && - this.Level.Equals(other.Level) - ) && - ( - this.Cause == other.Cause || - this.Cause != null && - this.Cause.Equals(other.Cause) - ) && - ( - this.Message == other.Message || - this.Message != null && - this.Message.Equals(other.Message) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.Code != null) - hash = hash * 59 + this.Code.GetHashCode(); - if (this.Level != null) - hash = hash * 59 + this.Level.GetHashCode(); - if (this.Cause != null) - hash = hash * 59 + this.Cause.GetHashCode(); - if (this.Message != null) - hash = hash * 59 + this.Message.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/ErrorResponse.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/ErrorResponse.cs deleted file mode 100644 index 153e598..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/ErrorResponse.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// The error response - /// - [DataContract] - public partial class ErrorResponse : IEquatable - { - /// - /// Initializes a new instance of the class. - /// - /// Errors. - public ErrorResponse(List Errors = null) - { - this.Errors = Errors; - } - - /// - /// Gets or Sets Errors - /// - [DataMember(Name="errors", EmitDefaultValue=false)] - public List Errors { get; set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ErrorResponse {\n"); - sb.Append(" Errors: ").Append(Errors).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as ErrorResponse); - } - - /// - /// Returns true if ErrorResponse instances are equal - /// - /// Instance of ErrorResponse to be compared - /// Boolean - public bool Equals(ErrorResponse other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.Errors == other.Errors || - this.Errors != null && - this.Errors.SequenceEqual(other.Errors) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.Errors != null) - hash = hash * 59 + this.Errors.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/Lifecycle.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/Lifecycle.cs deleted file mode 100644 index 08581b5..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/Lifecycle.cs +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// Lifecycle settings. When no lifecycle settings are supplied, the job and files will be deleted directly after retrieval of the file - /// - [DataContract] - public partial class Lifecycle : IEquatable - { - /// - /// Gets or Sets Action - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum ActionEnum - { - - /// - /// Enum DELETE for "DELETE" - /// - [EnumMember(Value = "DELETE")] - DELETE - } - - /// - /// Gets or Sets Type - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum TypeEnum - { - - /// - /// Enum RETRIEVAL for "RETRIEVAL" - /// - [EnumMember(Value = "RETRIEVAL")] - RETRIEVAL, - - /// - /// Enum TIME for "TIME" - /// - [EnumMember(Value = "TIME")] - TIME - } - - /// - /// Gets or Sets Action - /// - [DataMember(Name="action", EmitDefaultValue=false)] - public ActionEnum? Action { get; set; } - /// - /// Gets or Sets Type - /// - [DataMember(Name="type", EmitDefaultValue=false)] - public TypeEnum? Type { get; set; } - /// - /// Initializes a new instance of the class. - /// - /// The time at which the job and files will be deleted, regardless of whether it has been retrieved or not. Maximal time is 1 day from job creation. - /// Action. - /// Type. - public Lifecycle(DateTime? ActionTime = null, ActionEnum? Action = null, TypeEnum? Type = null) - { - this.ActionTime = ActionTime; - this.Action = Action; - this.Type = Type; - } - - /// - /// The time at which the job and files will be deleted, regardless of whether it has been retrieved or not. Maximal time is 1 day from job creation - /// - /// The time at which the job and files will be deleted, regardless of whether it has been retrieved or not. Maximal time is 1 day from job creation - [DataMember(Name="actionTime", EmitDefaultValue=false)] - public DateTime? ActionTime { get; set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Lifecycle {\n"); - sb.Append(" ActionTime: ").Append(ActionTime).Append("\n"); - sb.Append(" Action: ").Append(Action).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as Lifecycle); - } - - /// - /// Returns true if Lifecycle instances are equal - /// - /// Instance of Lifecycle to be compared - /// Boolean - public bool Equals(Lifecycle other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.ActionTime == other.ActionTime || - this.ActionTime != null && - this.ActionTime.Equals(other.ActionTime) - ) && - ( - this.Action == other.Action || - this.Action != null && - this.Action.Equals(other.Action) - ) && - ( - this.Type == other.Type || - this.Type != null && - this.Type.Equals(other.Type) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.ActionTime != null) - hash = hash * 59 + this.ActionTime.GetHashCode(); - if (this.Action != null) - hash = hash * 59 + this.Action.GetHashCode(); - if (this.Type != null) - hash = hash * 59 + this.Type.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/MergeJob.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/MergeJob.cs deleted file mode 100644 index 9cceb43..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/MergeJob.cs +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// The merge job. Has access to the job merge data. - /// - [DataContract] - public partial class MergeJob : IEquatable - { - /// - /// The status of the job - /// - /// The status of the job - [JsonConverter(typeof(StringEnumConverter))] - public enum StatusEnum - { - - /// - /// Enum CREATED for "CREATED" - /// - [EnumMember(Value = "CREATED")] - CREATED, - - /// - /// Enum UPDATED for "UPDATED" - /// - [EnumMember(Value = "UPDATED")] - UPDATED, - - /// - /// Enum PROCESSING for "PROCESSING" - /// - [EnumMember(Value = "PROCESSING")] - PROCESSING, - - /// - /// Enum DONE for "DONE" - /// - [EnumMember(Value = "DONE")] - DONE, - - /// - /// Enum ERROR for "ERROR" - /// - [EnumMember(Value = "ERROR")] - ERROR, - - /// - /// Enum DELETED for "DELETED" - /// - [EnumMember(Value = "DELETED")] - DELETED - } - - /// - /// The status of the job - /// - /// The status of the job - [DataMember(Name="status", EmitDefaultValue=false)] - public StatusEnum? Status { get; set; } - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected MergeJob() { } - /// - /// Initializes a new instance of the class. - /// - /// The target folder path of result files. - /// The server generated job jobId. This jobId is checked against the jobId in the request path on every invocation (required). - /// The target container id of result files. - /// Data set id. - /// The storage locations of the result files. (required). - /// Header data set ids. - /// MergeSettings. - public MergeJob(string ResultFolderPath = null, string JobId = null, string ResultContainerId = null, string DataSetId = null, List ResultStreams = null, List HeaderDataSetIds = null, MergeSettings MergeSettings = null) - { - // to ensure "JobId" is required (not null) - if (JobId == null) - { - throw new InvalidDataException("JobId is a required property for MergeJob and cannot be null"); - } - else - { - this.JobId = JobId; - } - // to ensure "ResultStreams" is required (not null) - if (ResultStreams == null) - { - throw new InvalidDataException("ResultStreams is a required property for MergeJob and cannot be null"); - } - else - { - this.ResultStreams = ResultStreams; - } - this.ResultFolderPath = ResultFolderPath; - this.ResultContainerId = ResultContainerId; - this.DataSetId = DataSetId; - this.HeaderDataSetIds = HeaderDataSetIds; - this.MergeSettings = MergeSettings; - } - - /// - /// The target folder path of result files - /// - /// The target folder path of result files - [DataMember(Name="resultFolderPath", EmitDefaultValue=false)] - public string ResultFolderPath { get; set; } - /// - /// The completion date/time of this job in ISO 8601 format - /// - /// The completion date/time of this job in ISO 8601 format - [DataMember(Name="completionTime", EmitDefaultValue=false)] - public DateTime? CompletionTime { get; private set; } - /// - /// The server generated job jobId. This jobId is checked against the jobId in the request path on every invocation - /// - /// The server generated job jobId. This jobId is checked against the jobId in the request path on every invocation - [DataMember(Name="jobId", EmitDefaultValue=false)] - public string JobId { get; set; } - /// - /// The target container id of result files - /// - /// The target container id of result files - [DataMember(Name="resultContainerId", EmitDefaultValue=false)] - public string ResultContainerId { get; set; } - /// - /// The creation date/time of this job in ISO 8601 format - /// - /// The creation date/time of this job in ISO 8601 format - [DataMember(Name="creationTime", EmitDefaultValue=false)] - public DateTime? CreationTime { get; private set; } - /// - /// Data set id - /// - /// Data set id - [DataMember(Name="dataSetId", EmitDefaultValue=false)] - public string DataSetId { get; set; } - /// - /// The storage locations of the result files. - /// - /// The storage locations of the result files. - [DataMember(Name="resultStreams", EmitDefaultValue=false)] - public List ResultStreams { get; set; } - /// - /// Header data set ids - /// - /// Header data set ids - [DataMember(Name="headerDataSetIds", EmitDefaultValue=false)] - public List HeaderDataSetIds { get; set; } - /// - /// Gets or Sets MergeSettings - /// - [DataMember(Name="mergeSettings", EmitDefaultValue=false)] - public MergeSettings MergeSettings { get; set; } - /// - /// A status message, which can be informational, warning or error. A message here does not indicate an error perse - /// - /// A status message, which can be informational, warning or error. A message here does not indicate an error perse - [DataMember(Name="statusMessage", EmitDefaultValue=false)] - public string StatusMessage { get; private set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class MergeJob {\n"); - sb.Append(" ResultFolderPath: ").Append(ResultFolderPath).Append("\n"); - sb.Append(" CompletionTime: ").Append(CompletionTime).Append("\n"); - sb.Append(" JobId: ").Append(JobId).Append("\n"); - sb.Append(" ResultContainerId: ").Append(ResultContainerId).Append("\n"); - sb.Append(" CreationTime: ").Append(CreationTime).Append("\n"); - sb.Append(" DataSetId: ").Append(DataSetId).Append("\n"); - sb.Append(" ResultStreams: ").Append(ResultStreams).Append("\n"); - sb.Append(" HeaderDataSetIds: ").Append(HeaderDataSetIds).Append("\n"); - sb.Append(" MergeSettings: ").Append(MergeSettings).Append("\n"); - sb.Append(" StatusMessage: ").Append(StatusMessage).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as MergeJob); - } - - /// - /// Returns true if MergeJob instances are equal - /// - /// Instance of MergeJob to be compared - /// Boolean - public bool Equals(MergeJob other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.ResultFolderPath == other.ResultFolderPath || - this.ResultFolderPath != null && - this.ResultFolderPath.Equals(other.ResultFolderPath) - ) && - ( - this.CompletionTime == other.CompletionTime || - this.CompletionTime != null && - this.CompletionTime.Equals(other.CompletionTime) - ) && - ( - this.JobId == other.JobId || - this.JobId != null && - this.JobId.Equals(other.JobId) - ) && - ( - this.ResultContainerId == other.ResultContainerId || - this.ResultContainerId != null && - this.ResultContainerId.Equals(other.ResultContainerId) - ) && - ( - this.CreationTime == other.CreationTime || - this.CreationTime != null && - this.CreationTime.Equals(other.CreationTime) - ) && - ( - this.DataSetId == other.DataSetId || - this.DataSetId != null && - this.DataSetId.Equals(other.DataSetId) - ) && - ( - this.ResultStreams == other.ResultStreams || - this.ResultStreams != null && - this.ResultStreams.SequenceEqual(other.ResultStreams) - ) && - ( - this.HeaderDataSetIds == other.HeaderDataSetIds || - this.HeaderDataSetIds != null && - this.HeaderDataSetIds.SequenceEqual(other.HeaderDataSetIds) - ) && - ( - this.MergeSettings == other.MergeSettings || - this.MergeSettings != null && - this.MergeSettings.Equals(other.MergeSettings) - ) && - ( - this.StatusMessage == other.StatusMessage || - this.StatusMessage != null && - this.StatusMessage.Equals(other.StatusMessage) - ) && - ( - this.Status == other.Status || - this.Status != null && - this.Status.Equals(other.Status) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.ResultFolderPath != null) - hash = hash * 59 + this.ResultFolderPath.GetHashCode(); - if (this.CompletionTime != null) - hash = hash * 59 + this.CompletionTime.GetHashCode(); - if (this.JobId != null) - hash = hash * 59 + this.JobId.GetHashCode(); - if (this.ResultContainerId != null) - hash = hash * 59 + this.ResultContainerId.GetHashCode(); - if (this.CreationTime != null) - hash = hash * 59 + this.CreationTime.GetHashCode(); - if (this.DataSetId != null) - hash = hash * 59 + this.DataSetId.GetHashCode(); - if (this.ResultStreams != null) - hash = hash * 59 + this.ResultStreams.GetHashCode(); - if (this.HeaderDataSetIds != null) - hash = hash * 59 + this.HeaderDataSetIds.GetHashCode(); - if (this.MergeSettings != null) - hash = hash * 59 + this.MergeSettings.GetHashCode(); - if (this.StatusMessage != null) - hash = hash * 59 + this.StatusMessage.GetHashCode(); - if (this.Status != null) - hash = hash * 59 + this.Status.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/MergeJobResponse.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/MergeJobResponse.cs deleted file mode 100644 index 6177500..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/MergeJobResponse.cs +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// The merge job response. - /// - [DataContract] - public partial class MergeJobResponse : IEquatable - { - /// - /// The status of the job - /// - /// The status of the job - [JsonConverter(typeof(StringEnumConverter))] - public enum StatusEnum - { - - /// - /// Enum CREATED for "CREATED" - /// - [EnumMember(Value = "CREATED")] - CREATED, - - /// - /// Enum UPDATED for "UPDATED" - /// - [EnumMember(Value = "UPDATED")] - UPDATED, - - /// - /// Enum PROCESSING for "PROCESSING" - /// - [EnumMember(Value = "PROCESSING")] - PROCESSING, - - /// - /// Enum DONE for "DONE" - /// - [EnumMember(Value = "DONE")] - DONE, - - /// - /// Enum ERROR for "ERROR" - /// - [EnumMember(Value = "ERROR")] - ERROR, - - /// - /// Enum DELETED for "DELETED" - /// - [EnumMember(Value = "DELETED")] - DELETED - } - - /// - /// The status of the job - /// - /// The status of the job - [DataMember(Name="status", EmitDefaultValue=false)] - public StatusEnum? Status { get; set; } - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected MergeJobResponse() { } - /// - /// Initializes a new instance of the class. - /// - /// The server generated job jobId. This jobId is checked against the jobId in the request path on overy invocation (required). - /// Job. - public MergeJobResponse(string JobId = null, MergeJob Job = null) - { - // to ensure "JobId" is required (not null) - if (JobId == null) - { - throw new InvalidDataException("JobId is a required property for MergeJobResponse and cannot be null"); - } - else - { - this.JobId = JobId; - } - this.Job = Job; - } - - /// - /// The server generated job jobId. This jobId is checked against the jobId in the request path on overy invocation - /// - /// The server generated job jobId. This jobId is checked against the jobId in the request path on overy invocation - [DataMember(Name="jobId", EmitDefaultValue=false)] - public string JobId { get; set; } - /// - /// Gets or Sets Job - /// - [DataMember(Name="job", EmitDefaultValue=false)] - public MergeJob Job { get; set; } - /// - /// A status message, which can be informational, warning or error. AA message here does not indicate an error perse - /// - /// A status message, which can be informational, warning or error. AA message here does not indicate an error perse - [DataMember(Name="statusMessage", EmitDefaultValue=false)] - public string StatusMessage { get; private set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class MergeJobResponse {\n"); - sb.Append(" JobId: ").Append(JobId).Append("\n"); - sb.Append(" Job: ").Append(Job).Append("\n"); - sb.Append(" StatusMessage: ").Append(StatusMessage).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as MergeJobResponse); - } - - /// - /// Returns true if MergeJobResponse instances are equal - /// - /// Instance of MergeJobResponse to be compared - /// Boolean - public bool Equals(MergeJobResponse other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.JobId == other.JobId || - this.JobId != null && - this.JobId.Equals(other.JobId) - ) && - ( - this.Job == other.Job || - this.Job != null && - this.Job.Equals(other.Job) - ) && - ( - this.StatusMessage == other.StatusMessage || - this.StatusMessage != null && - this.StatusMessage.Equals(other.StatusMessage) - ) && - ( - this.Status == other.Status || - this.Status != null && - this.Status.Equals(other.Status) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.JobId != null) - hash = hash * 59 + this.JobId.GetHashCode(); - if (this.Job != null) - hash = hash * 59 + this.Job.GetHashCode(); - if (this.StatusMessage != null) - hash = hash * 59 + this.StatusMessage.GetHashCode(); - if (this.Status != null) - hash = hash * 59 + this.Status.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/MergeSettings.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/MergeSettings.cs deleted file mode 100644 index 9226d13..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/MergeSettings.cs +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// Merge settings - /// - [DataContract] - public partial class MergeSettings : IEquatable - { - /// - /// Gets or Sets MergeResult - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum MergeResultEnum - { - - /// - /// Enum SINGLEFILE for "SINGLE_FILE" - /// - [EnumMember(Value = "SINGLE_FILE")] - SINGLEFILE, - - /// - /// Enum SEPARATEFILES for "SEPARATE_FILES" - /// - [EnumMember(Value = "SEPARATE_FILES")] - SEPARATEFILES - } - - /// - /// Gets or Sets Engine - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum EngineEnum - { - - /// - /// Enum BASIC for "BASIC" - /// - [EnumMember(Value = "BASIC")] - BASIC, - - /// - /// Enum PREMIUM for "PREMIUM" - /// - [EnumMember(Value = "PREMIUM")] - PREMIUM - } - - /// - /// Gets or Sets MergeResult - /// - [DataMember(Name="mergeResult", EmitDefaultValue=false)] - public MergeResultEnum? MergeResult { get; set; } - /// - /// Gets or Sets Engine - /// - [DataMember(Name="engine", EmitDefaultValue=false)] - public EngineEnum? Engine { get; set; } - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected MergeSettings() { } - /// - /// Initializes a new instance of the class. - /// - /// Lifecycle. - /// MergeResult. - /// Data set id (required). - /// Engine. - /// optional header data set ids. - /// Template version. - /// The output location of the result files. (required). - /// Template id (required). - /// OutputSettings (required). - public MergeSettings(Lifecycle Lifecycle = null, MergeResultEnum? MergeResult = null, string DataSetId = null, EngineEnum? Engine = null, List HeaderDataSetIds = null, int? TemplateVersion = null, StreamLocation ResultStreamLocation = null, string TemplateId = null, OutputSettings OutputSettings = null) - { - // to ensure "DataSetId" is required (not null) - if (DataSetId == null) - { - throw new InvalidDataException("DataSetId is a required property for MergeSettings and cannot be null"); - } - else - { - this.DataSetId = DataSetId; - } - // to ensure "ResultStreamLocation" is required (not null) - if (ResultStreamLocation == null) - { - throw new InvalidDataException("ResultStreamLocation is a required property for MergeSettings and cannot be null"); - } - else - { - this.ResultStreamLocation = ResultStreamLocation; - } - // to ensure "TemplateId" is required (not null) - if (TemplateId == null) - { - throw new InvalidDataException("TemplateId is a required property for MergeSettings and cannot be null"); - } - else - { - this.TemplateId = TemplateId; - } - // to ensure "OutputSettings" is required (not null) - if (OutputSettings == null) - { - throw new InvalidDataException("OutputSettings is a required property for MergeSettings and cannot be null"); - } - else - { - this.OutputSettings = OutputSettings; - } - this.Lifecycle = Lifecycle; - this.MergeResult = MergeResult; - this.Engine = Engine; - this.HeaderDataSetIds = HeaderDataSetIds; - this.TemplateVersion = TemplateVersion; - } - - /// - /// Gets or Sets Lifecycle - /// - [DataMember(Name="lifecycle", EmitDefaultValue=false)] - public Lifecycle Lifecycle { get; set; } - /// - /// Data set id - /// - /// Data set id - [DataMember(Name="dataSetId", EmitDefaultValue=false)] - public string DataSetId { get; set; } - /// - /// optional header data set ids - /// - /// optional header data set ids - [DataMember(Name="headerDataSetIds", EmitDefaultValue=false)] - public List HeaderDataSetIds { get; set; } - /// - /// Template version - /// - /// Template version - [DataMember(Name="templateVersion", EmitDefaultValue=false)] - public int? TemplateVersion { get; set; } - /// - /// The output location of the result files. - /// - /// The output location of the result files. - [DataMember(Name="resultStreamLocation", EmitDefaultValue=false)] - public StreamLocation ResultStreamLocation { get; set; } - /// - /// Template id - /// - /// Template id - [DataMember(Name="templateId", EmitDefaultValue=false)] - public string TemplateId { get; set; } - /// - /// Gets or Sets OutputSettings - /// - [DataMember(Name="outputSettings", EmitDefaultValue=false)] - public OutputSettings OutputSettings { get; set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class MergeSettings {\n"); - sb.Append(" Lifecycle: ").Append(Lifecycle).Append("\n"); - sb.Append(" MergeResult: ").Append(MergeResult).Append("\n"); - sb.Append(" DataSetId: ").Append(DataSetId).Append("\n"); - sb.Append(" Engine: ").Append(Engine).Append("\n"); - sb.Append(" HeaderDataSetIds: ").Append(HeaderDataSetIds).Append("\n"); - sb.Append(" TemplateVersion: ").Append(TemplateVersion).Append("\n"); - sb.Append(" ResultStreamLocation: ").Append(ResultStreamLocation).Append("\n"); - sb.Append(" TemplateId: ").Append(TemplateId).Append("\n"); - sb.Append(" OutputSettings: ").Append(OutputSettings).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as MergeSettings); - } - - /// - /// Returns true if MergeSettings instances are equal - /// - /// Instance of MergeSettings to be compared - /// Boolean - public bool Equals(MergeSettings other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.Lifecycle == other.Lifecycle || - this.Lifecycle != null && - this.Lifecycle.Equals(other.Lifecycle) - ) && - ( - this.MergeResult == other.MergeResult || - this.MergeResult != null && - this.MergeResult.Equals(other.MergeResult) - ) && - ( - this.DataSetId == other.DataSetId || - this.DataSetId != null && - this.DataSetId.Equals(other.DataSetId) - ) && - ( - this.Engine == other.Engine || - this.Engine != null && - this.Engine.Equals(other.Engine) - ) && - ( - this.HeaderDataSetIds == other.HeaderDataSetIds || - this.HeaderDataSetIds != null && - this.HeaderDataSetIds.SequenceEqual(other.HeaderDataSetIds) - ) && - ( - this.TemplateVersion == other.TemplateVersion || - this.TemplateVersion != null && - this.TemplateVersion.Equals(other.TemplateVersion) - ) && - ( - this.ResultStreamLocation == other.ResultStreamLocation || - this.ResultStreamLocation != null && - this.ResultStreamLocation.Equals(other.ResultStreamLocation) - ) && - ( - this.TemplateId == other.TemplateId || - this.TemplateId != null && - this.TemplateId.Equals(other.TemplateId) - ) && - ( - this.OutputSettings == other.OutputSettings || - this.OutputSettings != null && - this.OutputSettings.Equals(other.OutputSettings) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.Lifecycle != null) - hash = hash * 59 + this.Lifecycle.GetHashCode(); - if (this.MergeResult != null) - hash = hash * 59 + this.MergeResult.GetHashCode(); - if (this.DataSetId != null) - hash = hash * 59 + this.DataSetId.GetHashCode(); - if (this.Engine != null) - hash = hash * 59 + this.Engine.GetHashCode(); - if (this.HeaderDataSetIds != null) - hash = hash * 59 + this.HeaderDataSetIds.GetHashCode(); - if (this.TemplateVersion != null) - hash = hash * 59 + this.TemplateVersion.GetHashCode(); - if (this.ResultStreamLocation != null) - hash = hash * 59 + this.ResultStreamLocation.GetHashCode(); - if (this.TemplateId != null) - hash = hash * 59 + this.TemplateId.GetHashCode(); - if (this.OutputSettings != null) - hash = hash * 59 + this.OutputSettings.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/OutputSettings.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/OutputSettings.cs deleted file mode 100644 index 783b5de..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/OutputSettings.cs +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// Output settings - /// - [DataContract] - public partial class OutputSettings : IEquatable - { - /// - /// Gets or Sets DeliveryFormat - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum DeliveryFormatEnum - { - - /// - /// Enum PLAIN for "PLAIN" - /// - [EnumMember(Value = "PLAIN")] - PLAIN, - - /// - /// Enum ZIP for "ZIP" - /// - [EnumMember(Value = "ZIP")] - ZIP, - - /// - /// Enum _7ZIP for "_7ZIP" - /// - [EnumMember(Value = "_7ZIP")] - _7ZIP - } - - /// - /// Gets or Sets OutputFormat - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum OutputFormatEnum - { - - /// - /// Enum DOC for "DOC" - /// - [EnumMember(Value = "DOC")] - DOC, - - /// - /// Enum DOCX for "DOCX" - /// - [EnumMember(Value = "DOCX")] - DOCX, - - /// - /// Enum RTF for "RTF" - /// - [EnumMember(Value = "RTF")] - RTF, - - /// - /// Enum PDF for "PDF" - /// - [EnumMember(Value = "PDF")] - PDF, - - /// - /// Enum XPS for "XPS" - /// - [EnumMember(Value = "XPS")] - XPS, - - /// - /// Enum SVG for "SVG" - /// - [EnumMember(Value = "SVG")] - SVG, - - /// - /// Enum HTML for "HTML" - /// - [EnumMember(Value = "HTML")] - HTML, - - /// - /// Enum ODT for "ODT" - /// - [EnumMember(Value = "ODT")] - ODT, - - /// - /// Enum TIFF for "TIFF" - /// - [EnumMember(Value = "TIFF")] - TIFF, - - /// - /// Enum PNG for "PNG" - /// - [EnumMember(Value = "PNG")] - PNG, - - /// - /// Enum BMP for "BMP" - /// - [EnumMember(Value = "BMP")] - BMP, - - /// - /// Enum JPEG for "JPEG" - /// - [EnumMember(Value = "JPEG")] - JPEG, - - /// - /// Enum TXT for "TXT" - /// - [EnumMember(Value = "TXT")] - TXT, - - /// - /// Enum XML for "XML" - /// - [EnumMember(Value = "XML")] - XML, - - /// - /// Enum JSON for "JSON" - /// - [EnumMember(Value = "JSON")] - JSON, - - /// - /// Enum DEFAULT for "DEFAULT" - /// - [EnumMember(Value = "DEFAULT")] - DEFAULT - } - - /// - /// Gets or Sets DeliveryFormat - /// - [DataMember(Name="deliveryFormat", EmitDefaultValue=false)] - public DeliveryFormatEnum? DeliveryFormat { get; set; } - /// - /// Gets or Sets OutputFormat - /// - [DataMember(Name="outputFormat", EmitDefaultValue=false)] - public OutputFormatEnum? OutputFormat { get; set; } - /// - /// Initializes a new instance of the class. - /// - /// DeliveryFormat. - /// OutputFormat. - public OutputSettings(DeliveryFormatEnum? DeliveryFormat = null, OutputFormatEnum? OutputFormat = null) - { - this.DeliveryFormat = DeliveryFormat; - this.OutputFormat = OutputFormat; - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OutputSettings {\n"); - sb.Append(" DeliveryFormat: ").Append(DeliveryFormat).Append("\n"); - sb.Append(" OutputFormat: ").Append(OutputFormat).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as OutputSettings); - } - - /// - /// Returns true if OutputSettings instances are equal - /// - /// Instance of OutputSettings to be compared - /// Boolean - public bool Equals(OutputSettings other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.DeliveryFormat == other.DeliveryFormat || - this.DeliveryFormat != null && - this.DeliveryFormat.Equals(other.DeliveryFormat) - ) && - ( - this.OutputFormat == other.OutputFormat || - this.OutputFormat != null && - this.OutputFormat.Equals(other.OutputFormat) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.DeliveryFormat != null) - hash = hash * 59 + this.DeliveryFormat.GetHashCode(); - if (this.OutputFormat != null) - hash = hash * 59 + this.OutputFormat.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/OwnerInfo.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/OwnerInfo.cs deleted file mode 100644 index 6c81cbb..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/OwnerInfo.cs +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// Owner info - /// - [DataContract] - public partial class OwnerInfo : IEquatable - { - /// - /// Initializes a new instance of the class. - /// - /// The owner's phone number. - /// The owner's company/department. - /// The owner's name. - /// The owner's email address. - public OwnerInfo(string Phone = null, string CompanyDepartment = null, string Name = null, string Email = null) - { - this.Phone = Phone; - this.CompanyDepartment = CompanyDepartment; - this.Name = Name; - this.Email = Email; - } - - /// - /// The owner's phone number - /// - /// The owner's phone number - [DataMember(Name="phone", EmitDefaultValue=false)] - public string Phone { get; set; } - /// - /// The owner's company/department - /// - /// The owner's company/department - [DataMember(Name="companyDepartment", EmitDefaultValue=false)] - public string CompanyDepartment { get; set; } - /// - /// The owner's name - /// - /// The owner's name - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } - /// - /// The owner's email address - /// - /// The owner's email address - [DataMember(Name="email", EmitDefaultValue=false)] - public string Email { get; set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OwnerInfo {\n"); - sb.Append(" Phone: ").Append(Phone).Append("\n"); - sb.Append(" CompanyDepartment: ").Append(CompanyDepartment).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Email: ").Append(Email).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as OwnerInfo); - } - - /// - /// Returns true if OwnerInfo instances are equal - /// - /// Instance of OwnerInfo to be compared - /// Boolean - public bool Equals(OwnerInfo other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.Phone == other.Phone || - this.Phone != null && - this.Phone.Equals(other.Phone) - ) && - ( - this.CompanyDepartment == other.CompanyDepartment || - this.CompanyDepartment != null && - this.CompanyDepartment.Equals(other.CompanyDepartment) - ) && - ( - this.Name == other.Name || - this.Name != null && - this.Name.Equals(other.Name) - ) && - ( - this.Email == other.Email || - this.Email != null && - this.Email.Equals(other.Email) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.Phone != null) - hash = hash * 59 + this.Phone.GetHashCode(); - if (this.CompanyDepartment != null) - hash = hash * 59 + this.CompanyDepartment.GetHashCode(); - if (this.Name != null) - hash = hash * 59 + this.Name.GetHashCode(); - if (this.Email != null) - hash = hash * 59 + this.Email.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/StreamLocation.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/StreamLocation.cs deleted file mode 100644 index 67616b3..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/StreamLocation.cs +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// Location record of data stream - /// - [DataContract] - public partial class StreamLocation : IEquatable - { - /// - /// Initializes a new instance of the class. - /// - /// FolderPath. - /// OriginalFileName. - /// ContainerId. - /// FileId. - public StreamLocation(string FolderPath = null, string OriginalFileName = null, string ContainerId = null, string FileId = null) - { - this.FolderPath = FolderPath; - this.OriginalFileName = OriginalFileName; - this.ContainerId = ContainerId; - this.FileId = FileId; - } - - /// - /// Gets or Sets FolderPath - /// - [DataMember(Name="folderPath", EmitDefaultValue=false)] - public string FolderPath { get; set; } - /// - /// Gets or Sets OriginalFileName - /// - [DataMember(Name="originalFileName", EmitDefaultValue=false)] - public string OriginalFileName { get; set; } - /// - /// Gets or Sets ContainerId - /// - [DataMember(Name="containerId", EmitDefaultValue=false)] - public string ContainerId { get; set; } - /// - /// Gets or Sets FileId - /// - [DataMember(Name="fileId", EmitDefaultValue=false)] - public string FileId { get; set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class StreamLocation {\n"); - sb.Append(" FolderPath: ").Append(FolderPath).Append("\n"); - sb.Append(" OriginalFileName: ").Append(OriginalFileName).Append("\n"); - sb.Append(" ContainerId: ").Append(ContainerId).Append("\n"); - sb.Append(" FileId: ").Append(FileId).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as StreamLocation); - } - - /// - /// Returns true if StreamLocation instances are equal - /// - /// Instance of StreamLocation to be compared - /// Boolean - public bool Equals(StreamLocation other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.FolderPath == other.FolderPath || - this.FolderPath != null && - this.FolderPath.Equals(other.FolderPath) - ) && - ( - this.OriginalFileName == other.OriginalFileName || - this.OriginalFileName != null && - this.OriginalFileName.Equals(other.OriginalFileName) - ) && - ( - this.ContainerId == other.ContainerId || - this.ContainerId != null && - this.ContainerId.Equals(other.ContainerId) - ) && - ( - this.FileId == other.FileId || - this.FileId != null && - this.FileId.Equals(other.FileId) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.FolderPath != null) - hash = hash * 59 + this.FolderPath.GetHashCode(); - if (this.OriginalFileName != null) - hash = hash * 59 + this.OriginalFileName.GetHashCode(); - if (this.ContainerId != null) - hash = hash * 59 + this.ContainerId.GetHashCode(); - if (this.FileId != null) - hash = hash * 59 + this.FileId.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/TemplateContext.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/TemplateContext.cs deleted file mode 100644 index 4bbec5b..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/TemplateContext.cs +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// TemplateContext - /// - [DataContract] - public partial class TemplateContext : IEquatable - { - /// - /// Gets or Sets TemplateType - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum TemplateTypeEnum - { - - /// - /// Enum OFFICE for "OFFICE" - /// - [EnumMember(Value = "OFFICE")] - OFFICE, - - /// - /// Enum FREEMARKER for "FREEMARKER" - /// - [EnumMember(Value = "FREEMARKER")] - FREEMARKER - } - - /// - /// Gets or Sets TemplateType - /// - [DataMember(Name="templateType", EmitDefaultValue=false)] - public TemplateTypeEnum? TemplateType { get; set; } - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected TemplateContext() { } - /// - /// Initializes a new instance of the class. - /// - /// TemplateType (required). - /// The template files (versioned). - /// The template description. - /// OwnerInfo. - /// Id. - /// The template context id. - public TemplateContext(TemplateTypeEnum? TemplateType = null, Dictionary TemplateFileLocations = null, string Description = null, OwnerInfo OwnerInfo = null, string Id = null, string TemplateId = null) - { - // to ensure "TemplateType" is required (not null) - if (TemplateType == null) - { - throw new InvalidDataException("TemplateType is a required property for TemplateContext and cannot be null"); - } - else - { - this.TemplateType = TemplateType; - } - this.TemplateFileLocations = TemplateFileLocations; - this.Description = Description; - this.OwnerInfo = OwnerInfo; - this.Id = Id; - this.TemplateId = TemplateId; - } - - /// - /// The template files (versioned) - /// - /// The template files (versioned) - [DataMember(Name="templateFileLocations", EmitDefaultValue=false)] - public Dictionary TemplateFileLocations { get; set; } - /// - /// The template description - /// - /// The template description - [DataMember(Name="description", EmitDefaultValue=false)] - public string Description { get; set; } - /// - /// Gets or Sets OwnerInfo - /// - [DataMember(Name="ownerInfo", EmitDefaultValue=false)] - public OwnerInfo OwnerInfo { get; set; } - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - public string Id { get; set; } - /// - /// The template context id - /// - /// The template context id - [DataMember(Name="templateId", EmitDefaultValue=false)] - public string TemplateId { get; set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class TemplateContext {\n"); - sb.Append(" TemplateType: ").Append(TemplateType).Append("\n"); - sb.Append(" TemplateFileLocations: ").Append(TemplateFileLocations).Append("\n"); - sb.Append(" Description: ").Append(Description).Append("\n"); - sb.Append(" OwnerInfo: ").Append(OwnerInfo).Append("\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" TemplateId: ").Append(TemplateId).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as TemplateContext); - } - - /// - /// Returns true if TemplateContext instances are equal - /// - /// Instance of TemplateContext to be compared - /// Boolean - public bool Equals(TemplateContext other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.TemplateType == other.TemplateType || - this.TemplateType != null && - this.TemplateType.Equals(other.TemplateType) - ) && - ( - this.TemplateFileLocations == other.TemplateFileLocations || - this.TemplateFileLocations != null && - this.TemplateFileLocations.SequenceEqual(other.TemplateFileLocations) - ) && - ( - this.Description == other.Description || - this.Description != null && - this.Description.Equals(other.Description) - ) && - ( - this.OwnerInfo == other.OwnerInfo || - this.OwnerInfo != null && - this.OwnerInfo.Equals(other.OwnerInfo) - ) && - ( - this.Id == other.Id || - this.Id != null && - this.Id.Equals(other.Id) - ) && - ( - this.TemplateId == other.TemplateId || - this.TemplateId != null && - this.TemplateId.Equals(other.TemplateId) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.TemplateType != null) - hash = hash * 59 + this.TemplateType.GetHashCode(); - if (this.TemplateFileLocations != null) - hash = hash * 59 + this.TemplateFileLocations.GetHashCode(); - if (this.Description != null) - hash = hash * 59 + this.Description.GetHashCode(); - if (this.OwnerInfo != null) - hash = hash * 59 + this.OwnerInfo.GetHashCode(); - if (this.Id != null) - hash = hash * 59 + this.Id.GetHashCode(); - if (this.TemplateId != null) - hash = hash * 59 + this.TemplateId.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/TemplateContextRequest.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/TemplateContextRequest.cs deleted file mode 100644 index 5abf21d..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/TemplateContextRequest.cs +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// The merge template request. - /// - [DataContract] - public partial class TemplateContextRequest : IEquatable - { - /// - /// Gets or Sets TemplateType - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum TemplateTypeEnum - { - - /// - /// Enum OFFICE for "OFFICE" - /// - [EnumMember(Value = "OFFICE")] - OFFICE, - - /// - /// Enum FREEMARKER for "FREEMARKER" - /// - [EnumMember(Value = "FREEMARKER")] - FREEMARKER - } - - /// - /// Gets or Sets TemplateType - /// - [DataMember(Name="templateType", EmitDefaultValue=false)] - public TemplateTypeEnum? TemplateType { get; set; } - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected TemplateContextRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// TemplateType (required). - /// Description. - /// OwnerInfo. - /// The template context id. - public TemplateContextRequest(TemplateTypeEnum? TemplateType = null, string Description = null, OwnerInfo OwnerInfo = null, string TemplateId = null) - { - // to ensure "TemplateType" is required (not null) - if (TemplateType == null) - { - throw new InvalidDataException("TemplateType is a required property for TemplateContextRequest and cannot be null"); - } - else - { - this.TemplateType = TemplateType; - } - this.Description = Description; - this.OwnerInfo = OwnerInfo; - this.TemplateId = TemplateId; - } - - /// - /// Gets or Sets Description - /// - [DataMember(Name="description", EmitDefaultValue=false)] - public string Description { get; set; } - /// - /// Gets or Sets OwnerInfo - /// - [DataMember(Name="ownerInfo", EmitDefaultValue=false)] - public OwnerInfo OwnerInfo { get; set; } - /// - /// The template context id - /// - /// The template context id - [DataMember(Name="templateId", EmitDefaultValue=false)] - public string TemplateId { get; set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class TemplateContextRequest {\n"); - sb.Append(" TemplateType: ").Append(TemplateType).Append("\n"); - sb.Append(" Description: ").Append(Description).Append("\n"); - sb.Append(" OwnerInfo: ").Append(OwnerInfo).Append("\n"); - sb.Append(" TemplateId: ").Append(TemplateId).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as TemplateContextRequest); - } - - /// - /// Returns true if TemplateContextRequest instances are equal - /// - /// Instance of TemplateContextRequest to be compared - /// Boolean - public bool Equals(TemplateContextRequest other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.TemplateType == other.TemplateType || - this.TemplateType != null && - this.TemplateType.Equals(other.TemplateType) - ) && - ( - this.Description == other.Description || - this.Description != null && - this.Description.Equals(other.Description) - ) && - ( - this.OwnerInfo == other.OwnerInfo || - this.OwnerInfo != null && - this.OwnerInfo.Equals(other.OwnerInfo) - ) && - ( - this.TemplateId == other.TemplateId || - this.TemplateId != null && - this.TemplateId.Equals(other.TemplateId) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.TemplateType != null) - hash = hash * 59 + this.TemplateType.GetHashCode(); - if (this.Description != null) - hash = hash * 59 + this.Description.GetHashCode(); - if (this.OwnerInfo != null) - hash = hash * 59 + this.OwnerInfo.GetHashCode(); - if (this.TemplateId != null) - hash = hash * 59 + this.TemplateId.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/TemplateContextResponse.cs b/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/TemplateContextResponse.cs deleted file mode 100644 index 4c6f91d..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Model/TemplateContextResponse.cs +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Sphereon.SDK.Template.Processor.Model -{ - /// - /// The merge template response. - /// - [DataContract] - public partial class TemplateContextResponse : IEquatable - { - /// - /// The status of the template - /// - /// The status of the template - [JsonConverter(typeof(StringEnumConverter))] - public enum StatusEnum - { - - /// - /// Enum CREATED for "CREATED" - /// - [EnumMember(Value = "CREATED")] - CREATED, - - /// - /// Enum UPDATED for "UPDATED" - /// - [EnumMember(Value = "UPDATED")] - UPDATED, - - /// - /// Enum DELETED for "DELETED" - /// - [EnumMember(Value = "DELETED")] - DELETED, - - /// - /// Enum PROCESSING for "PROCESSING" - /// - [EnumMember(Value = "PROCESSING")] - PROCESSING - } - - /// - /// The status of the template - /// - /// The status of the template - [DataMember(Name="status", EmitDefaultValue=false)] - public StatusEnum? Status { get; set; } - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected TemplateContextResponse() { } - /// - /// Initializes a new instance of the class. - /// - /// Context. - /// Unique template context id (required). - public TemplateContextResponse(TemplateContext Context = null, string Id = null) - { - // to ensure "Id" is required (not null) - if (Id == null) - { - throw new InvalidDataException("Id is a required property for TemplateContextResponse and cannot be null"); - } - else - { - this.Id = Id; - } - this.Context = Context; - } - - /// - /// The creation date/time of this response in ISO 8601 format - /// - /// The creation date/time of this response in ISO 8601 format - [DataMember(Name="creationTime", EmitDefaultValue=false)] - public DateTime? CreationTime { get; private set; } - /// - /// Gets or Sets Context - /// - [DataMember(Name="context", EmitDefaultValue=false)] - public TemplateContext Context { get; set; } - /// - /// Unique template context id - /// - /// Unique template context id - [DataMember(Name="id", EmitDefaultValue=false)] - public string Id { get; set; } - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class TemplateContextResponse {\n"); - sb.Append(" CreationTime: ").Append(CreationTime).Append("\n"); - sb.Append(" Context: ").Append(Context).Append("\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as TemplateContextResponse); - } - - /// - /// Returns true if TemplateContextResponse instances are equal - /// - /// Instance of TemplateContextResponse to be compared - /// Boolean - public bool Equals(TemplateContextResponse other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return - ( - this.CreationTime == other.CreationTime || - this.CreationTime != null && - this.CreationTime.Equals(other.CreationTime) - ) && - ( - this.Context == other.Context || - this.Context != null && - this.Context.Equals(other.Context) - ) && - ( - this.Id == other.Id || - this.Id != null && - this.Id.Equals(other.Id) - ) && - ( - this.Status == other.Status || - this.Status != null && - this.Status.Equals(other.Status) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - // credit: http://stackoverflow.com/a/263416/677735 - unchecked // Overflow is fine, just wrap - { - int hash = 41; - // Suitable nullity checks etc, of course :) - if (this.CreationTime != null) - hash = hash * 59 + this.CreationTime.GetHashCode(); - if (this.Context != null) - hash = hash * 59 + this.Context.GetHashCode(); - if (this.Id != null) - hash = hash * 59 + this.Id.GetHashCode(); - if (this.Status != null) - hash = hash * 59 + this.Status.GetHashCode(); - return hash; - } - } - } - -} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/packages.config b/csharp-net45/src/Sphereon.SDK.Template.Processor/packages.config deleted file mode 100644 index 80f617d..0000000 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/AllApiTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/AllApiTests.cs new file mode 100644 index 0000000..0236738 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/AllApiTests.cs @@ -0,0 +1,228 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing AllApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class AllApiTests + { + private AllApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new AllApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of AllApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' AllApi + //Assert.IsInstanceOfType(typeof(AllApi), instance, "instance is a AllApi"); + } + + + /// + /// Test CreateDataSet + /// + [Test] + public void CreateDataSetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string payload = null; + //var response = instance.CreateDataSet(payload); + //Assert.IsInstanceOf (response, "response is DataSetResponse"); + } + + /// + /// Test CreateTemplateContext + /// + [Test] + public void CreateTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //TemplateContextRequest templateRequest = null; + //var response = instance.CreateTemplateContext(templateRequest); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test DeleteDataSet + /// + [Test] + public void DeleteDataSetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string dataSetId = null; + //var response = instance.DeleteDataSet(dataSetId); + //Assert.IsInstanceOf (response, "response is DataSetResponse"); + } + + /// + /// Test DeleteJob + /// + [Test] + public void DeleteJobTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //var response = instance.DeleteJob(jobId); + //Assert.IsInstanceOf (response, "response is MergeJobResponse"); + } + + /// + /// Test DeleteTemplateContext + /// + [Test] + public void DeleteTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //var response = instance.DeleteTemplateContext(templateId); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test GetJob + /// + [Test] + public void GetJobTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //var response = instance.GetJob(jobId); + //Assert.IsInstanceOf (response, "response is MergeJobResponse"); + } + + /// + /// Test GetJobs + /// + [Test] + public void GetJobsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List status = null; + //var response = instance.GetJobs(status); + //Assert.IsInstanceOf> (response, "response is List"); + } + + /// + /// Test GetResultStream + /// + [Test] + public void GetResultStreamTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //ResultStreamRequest resultStreamRequest = null; + //var response = instance.GetResultStream(jobId, resultStreamRequest); + //Assert.IsInstanceOf (response, "response is byte[]"); + } + + /// + /// Test GetResultStreamsAsContainer + /// + [Test] + public void GetResultStreamsAsContainerTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //OutputSettings outputSettings = null; + //var response = instance.GetResultStreamsAsContainer(jobId, outputSettings); + //Assert.IsInstanceOf (response, "response is byte[]"); + } + + /// + /// Test GetTemplateContext + /// + [Test] + public void GetTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //var response = instance.GetTemplateContext(templateId); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test SubmitJob + /// + [Test] + public void SubmitJobTest() + { + // TODO uncomment below to test the method and replace null with proper value + //MergeSettings mergesettings = null; + //var response = instance.SubmitJob(mergesettings); + //Assert.IsInstanceOf (response, "response is MergeJobResponse"); + } + + /// + /// Test UpdateTemplateContext + /// + [Test] + public void UpdateTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //TemplateContext templateContext = null; + //var response = instance.UpdateTemplateContext(templateContext); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test UploadTemplateFile + /// + [Test] + public void UploadTemplateFileTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //System.IO.Stream stream = null; + //var response = instance.UploadTemplateFile(templateId, stream); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/DataSetApiTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/DataSetApiTests.cs new file mode 100644 index 0000000..8a6a2bc --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/DataSetApiTests.cs @@ -0,0 +1,93 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing DataSetApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class DataSetApiTests + { + private DataSetApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new DataSetApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of DataSetApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' DataSetApi + //Assert.IsInstanceOfType(typeof(DataSetApi), instance, "instance is a DataSetApi"); + } + + + /// + /// Test CreateDataSet + /// + [Test] + public void CreateDataSetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string payload = null; + //var response = instance.CreateDataSet(payload); + //Assert.IsInstanceOf (response, "response is DataSetResponse"); + } + + /// + /// Test DeleteDataSet + /// + [Test] + public void DeleteDataSetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string dataSetId = null; + //var response = instance.DeleteDataSet(dataSetId); + //Assert.IsInstanceOf (response, "response is DataSetResponse"); + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/JobApiTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/JobApiTests.cs new file mode 100644 index 0000000..c41db53 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/JobApiTests.cs @@ -0,0 +1,131 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing JobApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class JobApiTests + { + private JobApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new JobApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of JobApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' JobApi + //Assert.IsInstanceOfType(typeof(JobApi), instance, "instance is a JobApi"); + } + + + /// + /// Test GetJob + /// + [Test] + public void GetJobTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //var response = instance.GetJob(jobId); + //Assert.IsInstanceOf (response, "response is MergeJobResponse"); + } + + /// + /// Test GetJobs + /// + [Test] + public void GetJobsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List status = null; + //var response = instance.GetJobs(status); + //Assert.IsInstanceOf> (response, "response is List"); + } + + /// + /// Test GetResultStream + /// + [Test] + public void GetResultStreamTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //ResultStreamRequest resultStreamRequest = null; + //var response = instance.GetResultStream(jobId, resultStreamRequest); + //Assert.IsInstanceOf (response, "response is byte[]"); + } + + /// + /// Test GetResultStreamsAsContainer + /// + [Test] + public void GetResultStreamsAsContainerTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string jobId = null; + //OutputSettings outputSettings = null; + //var response = instance.GetResultStreamsAsContainer(jobId, outputSettings); + //Assert.IsInstanceOf (response, "response is byte[]"); + } + + /// + /// Test SubmitJob + /// + [Test] + public void SubmitJobTest() + { + // TODO uncomment below to test the method and replace null with proper value + //MergeSettings mergesettings = null; + //var response = instance.SubmitJob(mergesettings); + //Assert.IsInstanceOf (response, "response is MergeJobResponse"); + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/TemplateApiTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/TemplateApiTests.cs new file mode 100644 index 0000000..db43f20 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Api/TemplateApiTests.cs @@ -0,0 +1,130 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using Sphereon.SDK.TemplateProcessor.Client; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing TemplateApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class TemplateApiTests + { + private TemplateApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new TemplateApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of TemplateApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' TemplateApi + //Assert.IsInstanceOfType(typeof(TemplateApi), instance, "instance is a TemplateApi"); + } + + + /// + /// Test CreateTemplateContext + /// + [Test] + public void CreateTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //TemplateContextRequest templateRequest = null; + //var response = instance.CreateTemplateContext(templateRequest); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test DeleteTemplateContext + /// + [Test] + public void DeleteTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //var response = instance.DeleteTemplateContext(templateId); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test GetTemplateContext + /// + [Test] + public void GetTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //var response = instance.GetTemplateContext(templateId); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test UpdateTemplateContext + /// + [Test] + public void UpdateTemplateContextTest() + { + // TODO uncomment below to test the method and replace null with proper value + //TemplateContext templateContext = null; + //var response = instance.UpdateTemplateContext(templateContext); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + /// + /// Test UploadTemplateFile + /// + [Test] + public void UploadTemplateFileTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string templateId = null; + //System.IO.Stream stream = null; + //var response = instance.UploadTemplateFile(templateId, stream); + //Assert.IsInstanceOf (response, "response is TemplateContextResponse"); + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ClaimParametersTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ClaimParametersTests.cs new file mode 100644 index 0000000..3cf5844 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ClaimParametersTests.cs @@ -0,0 +1,110 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing ClaimParameters + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ClaimParametersTests + { + // TODO uncomment below to declare an instance variable for ClaimParameters + //private ClaimParameters instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ClaimParameters + //instance = new ClaimParameters(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ClaimParameters + /// + [Test] + public void ClaimParametersInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ClaimParameters + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ClaimParameters"); + } + + /// + /// Test the property 'ApiEndUser' + /// + [Test] + public void ApiEndUserTest() + { + // TODO unit test for the property 'ApiEndUser' + } + /// + /// Test the property 'ApplicationId' + /// + [Test] + public void ApplicationIdTest() + { + // TODO unit test for the property 'ApplicationId' + } + /// + /// Test the property 'KeyType' + /// + [Test] + public void KeyTypeTest() + { + // TODO unit test for the property 'KeyType' + } + /// + /// Test the property 'SphereonIdentifier' + /// + [Test] + public void SphereonIdentifierTest() + { + // TODO unit test for the property 'SphereonIdentifier' + } + /// + /// Test the property 'ApiSupplierTenantId' + /// + [Test] + public void ApiSupplierTenantIdTest() + { + // TODO unit test for the property 'ApiSupplierTenantId' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/DataSetResponseTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/DataSetResponseTests.cs new file mode 100644 index 0000000..1284c80 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/DataSetResponseTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing DataSetResponse + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class DataSetResponseTests + { + // TODO uncomment below to declare an instance variable for DataSetResponse + //private DataSetResponse instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of DataSetResponse + //instance = new DataSetResponse(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of DataSetResponse + /// + [Test] + public void DataSetResponseInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" DataSetResponse + //Assert.IsInstanceOfType (instance, "variable 'instance' is a DataSetResponse"); + } + + /// + /// Test the property 'CompletionTime' + /// + [Test] + public void CompletionTimeTest() + { + // TODO unit test for the property 'CompletionTime' + } + /// + /// Test the property 'CreationTime' + /// + [Test] + public void CreationTimeTest() + { + // TODO unit test for the property 'CreationTime' + } + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorResponseTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorResponseTests.cs new file mode 100644 index 0000000..96404c2 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorResponseTests.cs @@ -0,0 +1,78 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing ErrorResponse + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ErrorResponseTests + { + // TODO uncomment below to declare an instance variable for ErrorResponse + //private ErrorResponse instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ErrorResponse + //instance = new ErrorResponse(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ErrorResponse + /// + [Test] + public void ErrorResponseInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ErrorResponse + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ErrorResponse"); + } + + /// + /// Test the property 'Errors' + /// + [Test] + public void ErrorsTest() + { + // TODO unit test for the property 'Errors' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorTests.cs new file mode 100644 index 0000000..bfd1f3f --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ErrorTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing Error + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ErrorTests + { + // TODO uncomment below to declare an instance variable for Error + //private Error instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Error + //instance = new Error(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Error + /// + [Test] + public void ErrorInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Error + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Error"); + } + + /// + /// Test the property 'Code' + /// + [Test] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + /// + /// Test the property 'Level' + /// + [Test] + public void LevelTest() + { + // TODO unit test for the property 'Level' + } + /// + /// Test the property 'Cause' + /// + [Test] + public void CauseTest() + { + // TODO unit test for the property 'Cause' + } + /// + /// Test the property 'Message' + /// + [Test] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/LifecycleTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/LifecycleTests.cs new file mode 100644 index 0000000..fa03e6a --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/LifecycleTests.cs @@ -0,0 +1,94 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing Lifecycle + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class LifecycleTests + { + // TODO uncomment below to declare an instance variable for Lifecycle + //private Lifecycle instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Lifecycle + //instance = new Lifecycle(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Lifecycle + /// + [Test] + public void LifecycleInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Lifecycle + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Lifecycle"); + } + + /// + /// Test the property 'ActionTime' + /// + [Test] + public void ActionTimeTest() + { + // TODO unit test for the property 'ActionTime' + } + /// + /// Test the property 'Action' + /// + [Test] + public void ActionTest() + { + // TODO unit test for the property 'Action' + } + /// + /// Test the property 'Type' + /// + [Test] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobResponseTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobResponseTests.cs new file mode 100644 index 0000000..93fdf24 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobResponseTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing MergeJobResponse + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class MergeJobResponseTests + { + // TODO uncomment below to declare an instance variable for MergeJobResponse + //private MergeJobResponse instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of MergeJobResponse + //instance = new MergeJobResponse(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of MergeJobResponse + /// + [Test] + public void MergeJobResponseInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" MergeJobResponse + //Assert.IsInstanceOfType (instance, "variable 'instance' is a MergeJobResponse"); + } + + /// + /// Test the property 'JobId' + /// + [Test] + public void JobIdTest() + { + // TODO unit test for the property 'JobId' + } + /// + /// Test the property 'Job' + /// + [Test] + public void JobTest() + { + // TODO unit test for the property 'Job' + } + /// + /// Test the property 'StatusMessage' + /// + [Test] + public void StatusMessageTest() + { + // TODO unit test for the property 'StatusMessage' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobTests.cs new file mode 100644 index 0000000..2c8cecd --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeJobTests.cs @@ -0,0 +1,150 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing MergeJob + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class MergeJobTests + { + // TODO uncomment below to declare an instance variable for MergeJob + //private MergeJob instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of MergeJob + //instance = new MergeJob(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of MergeJob + /// + [Test] + public void MergeJobInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" MergeJob + //Assert.IsInstanceOfType (instance, "variable 'instance' is a MergeJob"); + } + + /// + /// Test the property 'CompletionTime' + /// + [Test] + public void CompletionTimeTest() + { + // TODO unit test for the property 'CompletionTime' + } + /// + /// Test the property 'JobId' + /// + [Test] + public void JobIdTest() + { + // TODO unit test for the property 'JobId' + } + /// + /// Test the property 'CreationTime' + /// + [Test] + public void CreationTimeTest() + { + // TODO unit test for the property 'CreationTime' + } + /// + /// Test the property 'DataSetId' + /// + [Test] + public void DataSetIdTest() + { + // TODO unit test for the property 'DataSetId' + } + /// + /// Test the property 'ResultStreams' + /// + [Test] + public void ResultStreamsTest() + { + // TODO unit test for the property 'ResultStreams' + } + /// + /// Test the property 'HeaderDataSetIds' + /// + [Test] + public void HeaderDataSetIdsTest() + { + // TODO unit test for the property 'HeaderDataSetIds' + } + /// + /// Test the property 'ResultStorageLocation' + /// + [Test] + public void ResultStorageLocationTest() + { + // TODO unit test for the property 'ResultStorageLocation' + } + /// + /// Test the property 'MergeSettings' + /// + [Test] + public void MergeSettingsTest() + { + // TODO unit test for the property 'MergeSettings' + } + /// + /// Test the property 'StatusMessage' + /// + [Test] + public void StatusMessageTest() + { + // TODO unit test for the property 'StatusMessage' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeSettingsTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeSettingsTests.cs new file mode 100644 index 0000000..cab853c --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/MergeSettingsTests.cs @@ -0,0 +1,142 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing MergeSettings + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class MergeSettingsTests + { + // TODO uncomment below to declare an instance variable for MergeSettings + //private MergeSettings instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of MergeSettings + //instance = new MergeSettings(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of MergeSettings + /// + [Test] + public void MergeSettingsInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" MergeSettings + //Assert.IsInstanceOfType (instance, "variable 'instance' is a MergeSettings"); + } + + /// + /// Test the property 'Lifecycle' + /// + [Test] + public void LifecycleTest() + { + // TODO unit test for the property 'Lifecycle' + } + /// + /// Test the property 'MergeResult' + /// + [Test] + public void MergeResultTest() + { + // TODO unit test for the property 'MergeResult' + } + /// + /// Test the property 'DataSetId' + /// + [Test] + public void DataSetIdTest() + { + // TODO unit test for the property 'DataSetId' + } + /// + /// Test the property 'Engine' + /// + [Test] + public void EngineTest() + { + // TODO unit test for the property 'Engine' + } + /// + /// Test the property 'HeaderDataSetIds' + /// + [Test] + public void HeaderDataSetIdsTest() + { + // TODO unit test for the property 'HeaderDataSetIds' + } + /// + /// Test the property 'ResultStorageLocation' + /// + [Test] + public void ResultStorageLocationTest() + { + // TODO unit test for the property 'ResultStorageLocation' + } + /// + /// Test the property 'TemplateVersion' + /// + [Test] + public void TemplateVersionTest() + { + // TODO unit test for the property 'TemplateVersion' + } + /// + /// Test the property 'TemplateId' + /// + [Test] + public void TemplateIdTest() + { + // TODO unit test for the property 'TemplateId' + } + /// + /// Test the property 'OutputSettings' + /// + [Test] + public void OutputSettingsTest() + { + // TODO unit test for the property 'OutputSettings' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/OutputSettingsTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/OutputSettingsTests.cs new file mode 100644 index 0000000..dea791e --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/OutputSettingsTests.cs @@ -0,0 +1,86 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing OutputSettings + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OutputSettingsTests + { + // TODO uncomment below to declare an instance variable for OutputSettings + //private OutputSettings instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OutputSettings + //instance = new OutputSettings(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OutputSettings + /// + [Test] + public void OutputSettingsInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OutputSettings + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OutputSettings"); + } + + /// + /// Test the property 'DeliveryFormat' + /// + [Test] + public void DeliveryFormatTest() + { + // TODO unit test for the property 'DeliveryFormat' + } + /// + /// Test the property 'OutputFormat' + /// + [Test] + public void OutputFormatTest() + { + // TODO unit test for the property 'OutputFormat' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/OwnerInfoTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/OwnerInfoTests.cs new file mode 100644 index 0000000..6db728f --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/OwnerInfoTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing OwnerInfo + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OwnerInfoTests + { + // TODO uncomment below to declare an instance variable for OwnerInfo + //private OwnerInfo instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OwnerInfo + //instance = new OwnerInfo(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OwnerInfo + /// + [Test] + public void OwnerInfoInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OwnerInfo + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OwnerInfo"); + } + + /// + /// Test the property 'Phone' + /// + [Test] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + /// + /// Test the property 'CompanyDepartment' + /// + [Test] + public void CompanyDepartmentTest() + { + // TODO unit test for the property 'CompanyDepartment' + } + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'Email' + /// + [Test] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ResultStreamRequestTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ResultStreamRequestTests.cs new file mode 100644 index 0000000..f2639a9 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/ResultStreamRequestTests.cs @@ -0,0 +1,86 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing ResultStreamRequest + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ResultStreamRequestTests + { + // TODO uncomment below to declare an instance variable for ResultStreamRequest + //private ResultStreamRequest instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of ResultStreamRequest + //instance = new ResultStreamRequest(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of ResultStreamRequest + /// + [Test] + public void ResultStreamRequestInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" ResultStreamRequest + //Assert.IsInstanceOfType (instance, "variable 'instance' is a ResultStreamRequest"); + } + + /// + /// Test the property 'StreamLocation' + /// + [Test] + public void StreamLocationTest() + { + // TODO unit test for the property 'StreamLocation' + } + /// + /// Test the property 'OutputSettings' + /// + [Test] + public void OutputSettingsTest() + { + // TODO unit test for the property 'OutputSettings' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/StorageLocationTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/StorageLocationTests.cs new file mode 100644 index 0000000..ed9d640 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/StorageLocationTests.cs @@ -0,0 +1,86 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing StorageLocation + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class StorageLocationTests + { + // TODO uncomment below to declare an instance variable for StorageLocation + //private StorageLocation instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of StorageLocation + //instance = new StorageLocation(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of StorageLocation + /// + [Test] + public void StorageLocationInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" StorageLocation + //Assert.IsInstanceOfType (instance, "variable 'instance' is a StorageLocation"); + } + + /// + /// Test the property 'FolderPath' + /// + [Test] + public void FolderPathTest() + { + // TODO unit test for the property 'FolderPath' + } + /// + /// Test the property 'ContainerId' + /// + [Test] + public void ContainerIdTest() + { + // TODO unit test for the property 'ContainerId' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/StreamLocationTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/StreamLocationTests.cs new file mode 100644 index 0000000..50b14bc --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/StreamLocationTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing StreamLocation + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class StreamLocationTests + { + // TODO uncomment below to declare an instance variable for StreamLocation + //private StreamLocation instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of StreamLocation + //instance = new StreamLocation(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of StreamLocation + /// + [Test] + public void StreamLocationInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" StreamLocation + //Assert.IsInstanceOfType (instance, "variable 'instance' is a StreamLocation"); + } + + /// + /// Test the property 'FolderPath' + /// + [Test] + public void FolderPathTest() + { + // TODO unit test for the property 'FolderPath' + } + /// + /// Test the property 'OriginalFileName' + /// + [Test] + public void OriginalFileNameTest() + { + // TODO unit test for the property 'OriginalFileName' + } + /// + /// Test the property 'FileName' + /// + [Test] + public void FileNameTest() + { + // TODO unit test for the property 'FileName' + } + /// + /// Test the property 'ContainerId' + /// + [Test] + public void ContainerIdTest() + { + // TODO unit test for the property 'ContainerId' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextRequestTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextRequestTests.cs new file mode 100644 index 0000000..99f6b69 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextRequestTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing TemplateContextRequest + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class TemplateContextRequestTests + { + // TODO uncomment below to declare an instance variable for TemplateContextRequest + //private TemplateContextRequest instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of TemplateContextRequest + //instance = new TemplateContextRequest(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of TemplateContextRequest + /// + [Test] + public void TemplateContextRequestInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" TemplateContextRequest + //Assert.IsInstanceOfType (instance, "variable 'instance' is a TemplateContextRequest"); + } + + /// + /// Test the property 'TemplateType' + /// + [Test] + public void TemplateTypeTest() + { + // TODO unit test for the property 'TemplateType' + } + /// + /// Test the property 'Description' + /// + [Test] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + /// + /// Test the property 'OwnerInfo' + /// + [Test] + public void OwnerInfoTest() + { + // TODO unit test for the property 'OwnerInfo' + } + /// + /// Test the property 'TemplateId' + /// + [Test] + public void TemplateIdTest() + { + // TODO unit test for the property 'TemplateId' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextResponseTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextResponseTests.cs new file mode 100644 index 0000000..d9ff836 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextResponseTests.cs @@ -0,0 +1,102 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing TemplateContextResponse + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class TemplateContextResponseTests + { + // TODO uncomment below to declare an instance variable for TemplateContextResponse + //private TemplateContextResponse instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of TemplateContextResponse + //instance = new TemplateContextResponse(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of TemplateContextResponse + /// + [Test] + public void TemplateContextResponseInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" TemplateContextResponse + //Assert.IsInstanceOfType (instance, "variable 'instance' is a TemplateContextResponse"); + } + + /// + /// Test the property 'CreationTime' + /// + [Test] + public void CreationTimeTest() + { + // TODO unit test for the property 'CreationTime' + } + /// + /// Test the property 'Context' + /// + [Test] + public void ContextTest() + { + // TODO unit test for the property 'Context' + } + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextTests.cs b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextTests.cs new file mode 100644 index 0000000..b4dfe48 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Model/TemplateContextTests.cs @@ -0,0 +1,126 @@ +/* + * Template-Processor + * + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Sphereon.SDK.TemplateProcessor.Api; +using Sphereon.SDK.TemplateProcessor.Model; +using Sphereon.SDK.TemplateProcessor.Client; +using System.Reflection; + +namespace Sphereon.SDK.TemplateProcessor.Test +{ + /// + /// Class for testing TemplateContext + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class TemplateContextTests + { + // TODO uncomment below to declare an instance variable for TemplateContext + //private TemplateContext instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of TemplateContext + //instance = new TemplateContext(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of TemplateContext + /// + [Test] + public void TemplateContextInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" TemplateContext + //Assert.IsInstanceOfType (instance, "variable 'instance' is a TemplateContext"); + } + + /// + /// Test the property 'TemplateType' + /// + [Test] + public void TemplateTypeTest() + { + // TODO unit test for the property 'TemplateType' + } + /// + /// Test the property 'TemplateFileLocations' + /// + [Test] + public void TemplateFileLocationsTest() + { + // TODO unit test for the property 'TemplateFileLocations' + } + /// + /// Test the property 'Description' + /// + [Test] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + /// + /// Test the property 'OwnerInfo' + /// + [Test] + public void OwnerInfoTest() + { + // TODO unit test for the property 'OwnerInfo' + } + /// + /// Test the property 'StorageLocation' + /// + [Test] + public void StorageLocationTest() + { + // TODO unit test for the property 'StorageLocation' + } + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'TemplateId' + /// + [Test] + public void TemplateIdTest() + { + // TODO unit test for the property 'TemplateId' + } + + } + +} diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Sphereon.SDK.Template.Processor.csproj b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Sphereon.SDK.TemplateProcessor.Test.csproj similarity index 54% rename from csharp-net45/src/Sphereon.SDK.Template.Processor/Sphereon.SDK.Template.Processor.csproj rename to csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Sphereon.SDK.TemplateProcessor.Test.csproj index d3b36a9..5c91fc6 100644 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Sphereon.SDK.Template.Processor.csproj +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/Sphereon.SDK.TemplateProcessor.Test.csproj @@ -6,29 +6,16 @@ Template-Processor OpenAPI spec version: 0.1 Contact: dev@sphereon.com -Generated by: https://github.com/swagger-api/swagger-codegen.git - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. --> Debug AnyCPU - {A73CC262-2AE2-45A8-A793-03A98EF00AAD} + {19F1DEBC-DE5E-4517-8062-F000CD499087} Library Properties - Sphereon.SDK.Template.Processor - Sphereon.SDK.Template.Processor + Sphereon.SDK.TemplateProcessor.Test + Sphereon.SDK.TemplateProcessor.Test v4.5 512 @@ -54,29 +41,43 @@ limitations under the License. + - $(SolutionDir)\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll - ..\..\vendor\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll + $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll - ..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll - ..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll - ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll + + $(SolutionDir)\packages\RestSharpSigned.105.1.0\lib\net45\RestSharp.dll + ..\packages\RestSharpSigned.105.1.0\lib\net45\RestSharp.dll + ..\..\packages\RestSharpSigned.105.1.0\lib\net45\RestSharp.dll + ..\..\vendor\RestSharpSigned.105.1.0\lib\net45\RestSharp.dll + + + $(SolutionDir)\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll + ..\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll + ..\..\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll + ..\..\vendor\NUnit.3.9.0\lib\nunit.framework.dll - + + + + {AADC8EF1-2461-4634-BC88-69AE7CD89B3E} + Sphereon.SDK.TemplateProcessor + + diff --git a/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/packages.config b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/packages.config new file mode 100644 index 0000000..d9142f9 --- /dev/null +++ b/csharp-net45/src/Sphereon.SDK.TemplateProcessor.Test/packages.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/html-docs/.swagger-codegen-ignore b/html-docs/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/html-docs/.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/html-docs/.swagger-codegen/VERSION b/html-docs/.swagger-codegen/VERSION new file mode 100644 index 0000000..a625450 --- /dev/null +++ b/html-docs/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/html-docs/index.html b/html-docs/index.html new file mode 100644 index 0000000..b230bf6 --- /dev/null +++ b/html-docs/index.html @@ -0,0 +1,13166 @@ + + + + + Template-Processor + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+

Template-Processor

+
+
+
+ +
+
+

All

+
+
+
+

createDataSet

+

Store dataset

+
+
+
+

+

Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job.

+

+
+
/datasets
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X POST "https://gw.api.cloud.sphereon.com/template/processor/0.1/datasets"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        String payload = payload_example; // String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+        try {
+            DataSetResponse result = apiInstance.createDataSet(payload);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#createDataSet");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        String payload = payload_example; // String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+        try {
+            DataSetResponse result = apiInstance.createDataSet(payload);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#createDataSet");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *payload = payload_example; // The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Store dataset
+[apiInstance createDataSetWith:payload
+              completionHandler: ^(DataSetResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var payload = payload_example; // {String} The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.createDataSet(payload, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class createDataSetExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var payload = payload_example;  // String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+            try
+            {
+                // Store dataset
+                DataSetResponse result = apiInstance.createDataSet(payload);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.createDataSet: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$payload = payload_example; // String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+try {
+    $result = $api_instance->createDataSet($payload);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->createDataSet: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $payload = WWW::SwaggerClient::Object::String->new(); # String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+eval { 
+    my $result = $api_instance->createDataSet(payload => $payload);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->createDataSet: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+payload = payload_example # String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+try: 
+    # Store dataset
+    api_response = api_instance.create_data_set(payload)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->createDataSet: %s\n" % e)
+
+
+ +

Parameters

+ + + +
Body parameters
+ + + + + + + + + +
NameDescription
payload * + + + +
+
+ + + +

Responses

+

Status: 200 - Data set received and stored

+ + + +
+
+
+ +
+ +
+
+ +

Status: 400 - Unsupported data set format

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

createTemplateContext

+

Create template context

+
+
+
+

+

Create a unique template context for your environment

+

+
+
/templates
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X POST "https://gw.api.cloud.sphereon.com/template/processor/0.1/templates"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        TemplateContextRequest templateRequest = ; // TemplateContextRequest | The template request
+        try {
+            TemplateContextResponse result = apiInstance.createTemplateContext(templateRequest);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#createTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        TemplateContextRequest templateRequest = ; // TemplateContextRequest | The template request
+        try {
+            TemplateContextResponse result = apiInstance.createTemplateContext(templateRequest);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#createTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+TemplateContextRequest *templateRequest = ; // The template request
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Create template context
+[apiInstance createTemplateContextWith:templateRequest
+              completionHandler: ^(TemplateContextResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var templateRequest = ; // {TemplateContextRequest} The template request
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.createTemplateContext(templateRequest, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class createTemplateContextExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var templateRequest = new TemplateContextRequest(); // TemplateContextRequest | The template request
+
+            try
+            {
+                // Create template context
+                TemplateContextResponse result = apiInstance.createTemplateContext(templateRequest);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.createTemplateContext: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$templateRequest = ; // TemplateContextRequest | The template request
+
+try {
+    $result = $api_instance->createTemplateContext($templateRequest);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->createTemplateContext: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $templateRequest = WWW::SwaggerClient::Object::TemplateContextRequest->new(); # TemplateContextRequest | The template request
+
+eval { 
+    my $result = $api_instance->createTemplateContext(templateRequest => $templateRequest);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->createTemplateContext: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+templateRequest =  # TemplateContextRequest | The template request
+
+try: 
+    # Create template context
+    api_response = api_instance.create_template_context(templateRequest)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->createTemplateContext: %s\n" % e)
+
+
+ +

Parameters

+ + + +
Body parameters
+ + + + + + + + + +
NameDescription
templateRequest * + + + +
+
+ + + +

Responses

+

Status: 200 - Template context created

+ + + +
+
+
+ +
+ +
+
+ +

Status: 400 - Template context already exists

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

deleteDataSet

+

Delete a stored data set

+
+
+
+

+

Delete a stored data set

+

+
+
/datasets/{dataSetId}
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X DELETE "https://gw.api.cloud.sphereon.com/template/processor/0.1/datasets/{dataSetId}"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        String dataSetId = dataSetId_example; // String | dataSetId
+        try {
+            DataSetResponse result = apiInstance.deleteDataSet(dataSetId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#deleteDataSet");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        String dataSetId = dataSetId_example; // String | dataSetId
+        try {
+            DataSetResponse result = apiInstance.deleteDataSet(dataSetId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#deleteDataSet");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *dataSetId = dataSetId_example; // dataSetId
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Delete a stored data set
+[apiInstance deleteDataSetWith:dataSetId
+              completionHandler: ^(DataSetResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var dataSetId = dataSetId_example; // {String} dataSetId
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.deleteDataSet(dataSetId, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class deleteDataSetExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var dataSetId = dataSetId_example;  // String | dataSetId
+
+            try
+            {
+                // Delete a stored data set
+                DataSetResponse result = apiInstance.deleteDataSet(dataSetId);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.deleteDataSet: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$dataSetId = dataSetId_example; // String | dataSetId
+
+try {
+    $result = $api_instance->deleteDataSet($dataSetId);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->deleteDataSet: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $dataSetId = dataSetId_example; # String | dataSetId
+
+eval { 
+    my $result = $api_instance->deleteDataSet(dataSetId => $dataSetId);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->deleteDataSet: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+dataSetId = dataSetId_example # String | dataSetId
+
+try: 
+    # Delete a stored data set
+    api_response = api_instance.delete_data_set(dataSetId)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->deleteDataSet: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
dataSetId* + + +
+
+
+ + String + + +
+ dataSetId +
+
+
+ Required +
+
+
+
+ + + + + +

Responses

+

Status: 200 - Successfully deleted the data set

+ + + +
+
+
+ +
+ +
+
+ +

Status: 400 - Could not delete data set

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Invalid data set id

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

deleteJob

+

Delete a job manually

+
+
+
+

+

Delete the merge job and all related files

+

+
+
/jobs/{jobId}
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X DELETE "https://gw.api.cloud.sphereon.com/template/processor/0.1/jobs/{jobId}"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        String jobId = jobId_example; // String | jobId
+        try {
+            MergeJobResponse result = apiInstance.deleteJob(jobId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#deleteJob");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        String jobId = jobId_example; // String | jobId
+        try {
+            MergeJobResponse result = apiInstance.deleteJob(jobId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#deleteJob");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *jobId = jobId_example; // jobId
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Delete a job manually
+[apiInstance deleteJobWith:jobId
+              completionHandler: ^(MergeJobResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var jobId = jobId_example; // {String} jobId
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.deleteJob(jobId, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class deleteJobExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var jobId = jobId_example;  // String | jobId
+
+            try
+            {
+                // Delete a job manually
+                MergeJobResponse result = apiInstance.deleteJob(jobId);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.deleteJob: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$jobId = jobId_example; // String | jobId
+
+try {
+    $result = $api_instance->deleteJob($jobId);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->deleteJob: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $jobId = jobId_example; # String | jobId
+
+eval { 
+    my $result = $api_instance->deleteJob(jobId => $jobId);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->deleteJob: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+jobId = jobId_example # String | jobId
+
+try: 
+    # Delete a job manually
+    api_response = api_instance.delete_job(jobId)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->deleteJob: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
jobId* + + +
+
+
+ + String + + +
+ jobId +
+
+
+ Required +
+
+
+
+ + + + + +

Responses

+

Status: 200 - Merge job returned and Job is done or in error

+ + + +
+
+
+ +
+ +
+
+ +

Status: 400 - Could not delete job

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Invalid job id

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

deleteTemplateContext

+

Delete template context

+
+
+
+

+

Delete a template context with all history

+

+
+
/templates/{templateId}
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X DELETE "https://gw.api.cloud.sphereon.com/template/processor/0.1/templates/{templateId}"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        String templateId = templateId_example; // String | templateId
+        try {
+            TemplateContextResponse result = apiInstance.deleteTemplateContext(templateId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#deleteTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        String templateId = templateId_example; // String | templateId
+        try {
+            TemplateContextResponse result = apiInstance.deleteTemplateContext(templateId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#deleteTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *templateId = templateId_example; // templateId
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Delete template context
+[apiInstance deleteTemplateContextWith:templateId
+              completionHandler: ^(TemplateContextResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var templateId = templateId_example; // {String} templateId
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.deleteTemplateContext(templateId, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class deleteTemplateContextExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var templateId = templateId_example;  // String | templateId
+
+            try
+            {
+                // Delete template context
+                TemplateContextResponse result = apiInstance.deleteTemplateContext(templateId);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.deleteTemplateContext: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$templateId = templateId_example; // String | templateId
+
+try {
+    $result = $api_instance->deleteTemplateContext($templateId);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->deleteTemplateContext: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $templateId = templateId_example; # String | templateId
+
+eval { 
+    my $result = $api_instance->deleteTemplateContext(templateId => $templateId);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->deleteTemplateContext: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+templateId = templateId_example # String | templateId
+
+try: 
+    # Delete template context
+    api_response = api_instance.delete_template_context(templateId)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->deleteTemplateContext: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
templateId* + + +
+
+
+ + String + + +
+ templateId +
+
+
+ Required +
+
+
+
+ + + + + +

Responses

+

Status: 200 - Template context deleted

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Template context not found

+ + + +
+
+
+ +
+ +
+
+ +

Status: 500 - Internal server error

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

getJob

+

Job definition and state

+
+
+
+

+

Get the merge job definition and current state. Please not that you can differentiate based on http response status

+

+
+
/jobs/{jobId}
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X GET "https://gw.api.cloud.sphereon.com/template/processor/0.1/jobs/{jobId}"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        String jobId = jobId_example; // String | jobId
+        try {
+            MergeJobResponse result = apiInstance.getJob(jobId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#getJob");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        String jobId = jobId_example; // String | jobId
+        try {
+            MergeJobResponse result = apiInstance.getJob(jobId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#getJob");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *jobId = jobId_example; // jobId
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Job definition and state
+[apiInstance getJobWith:jobId
+              completionHandler: ^(MergeJobResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var jobId = jobId_example; // {String} jobId
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.getJob(jobId, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class getJobExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var jobId = jobId_example;  // String | jobId
+
+            try
+            {
+                // Job definition and state
+                MergeJobResponse result = apiInstance.getJob(jobId);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.getJob: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$jobId = jobId_example; // String | jobId
+
+try {
+    $result = $api_instance->getJob($jobId);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->getJob: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $jobId = jobId_example; # String | jobId
+
+eval { 
+    my $result = $api_instance->getJob(jobId => $jobId);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->getJob: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+jobId = jobId_example # String | jobId
+
+try: 
+    # Job definition and state
+    api_response = api_instance.get_job(jobId)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->getJob: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
jobId* + + +
+
+
+ + String + + +
+ jobId +
+
+
+ Required +
+
+
+
+ + + + + +

Responses

+

Status: 200 - Merge job returned and Job is done or in error

+ + + +
+
+
+ +
+ +
+
+ +

Status: 202 - Merge job returned and Job is still processing

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Invalid job id

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

getJobs

+

Get all jobs

+
+
+
+

+

Get all office text job definitions and their current state.

+

+
+
/jobs
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X GET "https://gw.api.cloud.sphereon.com/template/processor/0.1/jobs?status="
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        array[String] status = ; // array[String] | A list of status to filter on.
+        try {
+            array[MergeJobResponse] result = apiInstance.getJobs(status);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#getJobs");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        array[String] status = ; // array[String] | A list of status to filter on.
+        try {
+            array[MergeJobResponse] result = apiInstance.getJobs(status);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#getJobs");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+array[String] *status = ; // A list of status to filter on. (optional)
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Get all jobs
+[apiInstance getJobsWith:status
+              completionHandler: ^(array[MergeJobResponse] output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var opts = { 
+  'status':  // {array[String]} A list of status to filter on.
+};
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.getJobs(opts, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class getJobsExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var status = new array[String](); // array[String] | A list of status to filter on. (optional) 
+
+            try
+            {
+                // Get all jobs
+                array[MergeJobResponse] result = apiInstance.getJobs(status);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.getJobs: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$status = ; // array[String] | A list of status to filter on.
+
+try {
+    $result = $api_instance->getJobs($status);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->getJobs: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $status = []; # array[String] | A list of status to filter on.
+
+eval { 
+    my $result = $api_instance->getJobs(status => $status);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->getJobs: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+status =  # array[String] | A list of status to filter on. (optional)
+
+try: 
+    # Get all jobs
+    api_response = api_instance.get_jobs(status=status)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->getJobs: %s\n" % e)
+
+
+ +

Parameters

+ + + + + +
Query parameters
+ + + + + + + + + +
NameDescription
status + + +
+
+
+ + array[String] + + +
+ A list of status to filter on. +
+
+
+
+
+ +

Responses

+

Status: 200 - All office text jobs that have not been deleted

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

getResultStream

+

Get the result file

+
+
+
+

+

Get a merge result document as a binary stream. +

+

+
+
/jobs/{jobId}/result/stream
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X PUT "https://gw.api.cloud.sphereon.com/template/processor/0.1/jobs/{jobId}/result/stream"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        String jobId = jobId_example; // String | jobId
+        ResultStreamRequest resultStreamRequest = ; // ResultStreamRequest | resultStreamRequest
+        try {
+            byte[] result = apiInstance.getResultStream(jobId, resultStreamRequest);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#getResultStream");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        String jobId = jobId_example; // String | jobId
+        ResultStreamRequest resultStreamRequest = ; // ResultStreamRequest | resultStreamRequest
+        try {
+            byte[] result = apiInstance.getResultStream(jobId, resultStreamRequest);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#getResultStream");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *jobId = jobId_example; // jobId
+ResultStreamRequest *resultStreamRequest = ; // resultStreamRequest
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Get the result file
+[apiInstance getResultStreamWith:jobId
+    resultStreamRequest:resultStreamRequest
+              completionHandler: ^(byte[] output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var jobId = jobId_example; // {String} jobId
+
+var resultStreamRequest = ; // {ResultStreamRequest} resultStreamRequest
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.getResultStream(jobId, resultStreamRequest, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class getResultStreamExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var jobId = jobId_example;  // String | jobId
+            var resultStreamRequest = new ResultStreamRequest(); // ResultStreamRequest | resultStreamRequest
+
+            try
+            {
+                // Get the result file
+                byte[] result = apiInstance.getResultStream(jobId, resultStreamRequest);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.getResultStream: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$jobId = jobId_example; // String | jobId
+$resultStreamRequest = ; // ResultStreamRequest | resultStreamRequest
+
+try {
+    $result = $api_instance->getResultStream($jobId, $resultStreamRequest);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->getResultStream: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $jobId = jobId_example; # String | jobId
+my $resultStreamRequest = WWW::SwaggerClient::Object::ResultStreamRequest->new(); # ResultStreamRequest | resultStreamRequest
+
+eval { 
+    my $result = $api_instance->getResultStream(jobId => $jobId, resultStreamRequest => $resultStreamRequest);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->getResultStream: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+jobId = jobId_example # String | jobId
+resultStreamRequest =  # ResultStreamRequest | resultStreamRequest
+
+try: 
+    # Get the result file
+    api_response = api_instance.get_result_stream(jobId, resultStreamRequest)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->getResultStream: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
jobId* + + +
+
+
+ + String + + +
+ jobId +
+
+
+ Required +
+
+
+
+ + +
Body parameters
+ + + + + + + + + +
NameDescription
resultStreamRequest * + + + +
+
+ + + +

Responses

+

Status: 200 - Result file successfully returned

+ + + +
+
+
+ +
+ +
+
+ +

Status: 202 - Result file not yet created. Job is still executing.

+ + + +
+
+
+ +
+ +
+
+ +

Status: 400 - Result file could not be created.

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

getResultStreamsAsContainer

+

Get the result file

+
+
+
+

+

Get all documents inside a compressed container as a binary stream. +

+

+
+
/jobs/{jobId}/result/container
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X PUT "https://gw.api.cloud.sphereon.com/template/processor/0.1/jobs/{jobId}/result/container"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        String jobId = jobId_example; // String | jobId
+        OutputSettings outputSettings = ; // OutputSettings | outputSettings
+        try {
+            byte[] result = apiInstance.getResultStreamsAsContainer(jobId, outputSettings);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#getResultStreamsAsContainer");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        String jobId = jobId_example; // String | jobId
+        OutputSettings outputSettings = ; // OutputSettings | outputSettings
+        try {
+            byte[] result = apiInstance.getResultStreamsAsContainer(jobId, outputSettings);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#getResultStreamsAsContainer");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *jobId = jobId_example; // jobId
+OutputSettings *outputSettings = ; // outputSettings (optional)
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Get the result file
+[apiInstance getResultStreamsAsContainerWith:jobId
+    outputSettings:outputSettings
+              completionHandler: ^(byte[] output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var jobId = jobId_example; // {String} jobId
+
+var opts = { 
+  'outputSettings':  // {OutputSettings} outputSettings
+};
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.getResultStreamsAsContainer(jobId, opts, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class getResultStreamsAsContainerExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var jobId = jobId_example;  // String | jobId
+            var outputSettings = new OutputSettings(); // OutputSettings | outputSettings (optional) 
+
+            try
+            {
+                // Get the result file
+                byte[] result = apiInstance.getResultStreamsAsContainer(jobId, outputSettings);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.getResultStreamsAsContainer: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$jobId = jobId_example; // String | jobId
+$outputSettings = ; // OutputSettings | outputSettings
+
+try {
+    $result = $api_instance->getResultStreamsAsContainer($jobId, $outputSettings);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->getResultStreamsAsContainer: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $jobId = jobId_example; # String | jobId
+my $outputSettings = WWW::SwaggerClient::Object::OutputSettings->new(); # OutputSettings | outputSettings
+
+eval { 
+    my $result = $api_instance->getResultStreamsAsContainer(jobId => $jobId, outputSettings => $outputSettings);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->getResultStreamsAsContainer: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+jobId = jobId_example # String | jobId
+outputSettings =  # OutputSettings | outputSettings (optional)
+
+try: 
+    # Get the result file
+    api_response = api_instance.get_result_streams_as_container(jobId, outputSettings=outputSettings)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->getResultStreamsAsContainer: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
jobId* + + +
+
+
+ + String + + +
+ jobId +
+
+
+ Required +
+
+
+
+ + +
Body parameters
+ + + + + + + + + +
NameDescription
outputSettings + + + +
+
+ + + +

Responses

+

Status: 200 - Result package successfully created and returned

+ + + +
+
+
+ +
+ +
+
+ +

Status: 202 - Result file not yet created. Job is still executing.

+ + + +
+
+
+ +
+ +
+
+ +

Status: 400 - Result file could not be created.

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

getTemplateContext

+

Get template context

+
+
+
+

+

Get an existing template context

+

+
+
/templates/{templateId}
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X GET "https://gw.api.cloud.sphereon.com/template/processor/0.1/templates/{templateId}"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        String templateId = templateId_example; // String | The template context name unique for your environment
+        try {
+            TemplateContextResponse result = apiInstance.getTemplateContext(templateId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#getTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        String templateId = templateId_example; // String | The template context name unique for your environment
+        try {
+            TemplateContextResponse result = apiInstance.getTemplateContext(templateId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#getTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *templateId = templateId_example; // The template context name unique for your environment
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Get template context
+[apiInstance getTemplateContextWith:templateId
+              completionHandler: ^(TemplateContextResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var templateId = templateId_example; // {String} The template context name unique for your environment
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.getTemplateContext(templateId, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class getTemplateContextExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var templateId = templateId_example;  // String | The template context name unique for your environment
+
+            try
+            {
+                // Get template context
+                TemplateContextResponse result = apiInstance.getTemplateContext(templateId);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.getTemplateContext: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$templateId = templateId_example; // String | The template context name unique for your environment
+
+try {
+    $result = $api_instance->getTemplateContext($templateId);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->getTemplateContext: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $templateId = templateId_example; # String | The template context name unique for your environment
+
+eval { 
+    my $result = $api_instance->getTemplateContext(templateId => $templateId);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->getTemplateContext: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+templateId = templateId_example # String | The template context name unique for your environment
+
+try: 
+    # Get template context
+    api_response = api_instance.get_template_context(templateId)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->getTemplateContext: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
templateId* + + +
+
+
+ + String + + +
+ The template context name unique for your environment +
+
+
+ Required +
+
+
+
+ + + + + +

Responses

+

Status: 200 - Template context found

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Template context not found

+ + + +
+
+
+ +
+ +
+
+ +

Status: 500 - Internal server error

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

submitJob

+

Submit merge job for processing

+
+
+
+

+

Submit merge job run.

+

+
+
/jobs
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X PUT "https://gw.api.cloud.sphereon.com/template/processor/0.1/jobs"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        MergeSettings mergesettings = ; // MergeSettings | The merge- and output settings
+        try {
+            MergeJobResponse result = apiInstance.submitJob(mergesettings);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#submitJob");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        MergeSettings mergesettings = ; // MergeSettings | The merge- and output settings
+        try {
+            MergeJobResponse result = apiInstance.submitJob(mergesettings);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#submitJob");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+MergeSettings *mergesettings = ; // The merge- and output settings
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Submit merge job for processing
+[apiInstance submitJobWith:mergesettings
+              completionHandler: ^(MergeJobResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var mergesettings = ; // {MergeSettings} The merge- and output settings
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.submitJob(mergesettings, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class submitJobExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var mergesettings = new MergeSettings(); // MergeSettings | The merge- and output settings
+
+            try
+            {
+                // Submit merge job for processing
+                MergeJobResponse result = apiInstance.submitJob(mergesettings);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.submitJob: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$mergesettings = ; // MergeSettings | The merge- and output settings
+
+try {
+    $result = $api_instance->submitJob($mergesettings);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->submitJob: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $mergesettings = WWW::SwaggerClient::Object::MergeSettings->new(); # MergeSettings | The merge- and output settings
+
+eval { 
+    my $result = $api_instance->submitJob(mergesettings => $mergesettings);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->submitJob: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+mergesettings =  # MergeSettings | The merge- and output settings
+
+try: 
+    # Submit merge job for processing
+    api_response = api_instance.submit_job(mergesettings)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->submitJob: %s\n" % e)
+
+
+ +

Parameters

+ + + +
Body parameters
+ + + + + + + + + +
NameDescription
mergesettings * + + + +
+
+ + + +

Responses

+

Status: 200 - Merge job submitted

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

updateTemplateContext

+

Update template context

+
+
+
+

+

Update an existing template context for your environment

+

+
+
/templates
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X PUT "https://gw.api.cloud.sphereon.com/template/processor/0.1/templates"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        TemplateContext templateContext = ; // TemplateContext | templateContext
+        try {
+            TemplateContextResponse result = apiInstance.updateTemplateContext(templateContext);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#updateTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        TemplateContext templateContext = ; // TemplateContext | templateContext
+        try {
+            TemplateContextResponse result = apiInstance.updateTemplateContext(templateContext);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#updateTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+TemplateContext *templateContext = ; // templateContext
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Update template context
+[apiInstance updateTemplateContextWith:templateContext
+              completionHandler: ^(TemplateContextResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var templateContext = ; // {TemplateContext} templateContext
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.updateTemplateContext(templateContext, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class updateTemplateContextExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var templateContext = new TemplateContext(); // TemplateContext | templateContext
+
+            try
+            {
+                // Update template context
+                TemplateContextResponse result = apiInstance.updateTemplateContext(templateContext);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.updateTemplateContext: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$templateContext = ; // TemplateContext | templateContext
+
+try {
+    $result = $api_instance->updateTemplateContext($templateContext);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->updateTemplateContext: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $templateContext = WWW::SwaggerClient::Object::TemplateContext->new(); # TemplateContext | templateContext
+
+eval { 
+    my $result = $api_instance->updateTemplateContext(templateContext => $templateContext);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->updateTemplateContext: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+templateContext =  # TemplateContext | templateContext
+
+try: 
+    # Update template context
+    api_response = api_instance.update_template_context(templateContext)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->updateTemplateContext: %s\n" % e)
+
+
+ +

Parameters

+ + + +
Body parameters
+ + + + + + + + + +
NameDescription
templateContext * + + + +
+
+ + + +

Responses

+

Status: 200 - Template context updated

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Template context not found

+ + + +
+
+
+ +
+ +
+
+ +

Status: 500 - Internal server error

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

uploadTemplateFile

+

Upload template file

+
+
+
+

+

Upload the Office template file

+

+
+
/templates/{templateId}
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X POST "https://gw.api.cloud.sphereon.com/template/processor/0.1/templates/{templateId}"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.AllApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        AllApi apiInstance = new AllApi();
+        String templateId = templateId_example; // String | The template context name unique for your environment
+        File stream = /path/to/file.txt; // File | The template (file/inputstream) to store
+        try {
+            TemplateContextResponse result = apiInstance.uploadTemplateFile(templateId, stream);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#uploadTemplateFile");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.AllApi;
+
+public class AllApiExample {
+
+    public static void main(String[] args) {
+        AllApi apiInstance = new AllApi();
+        String templateId = templateId_example; // String | The template context name unique for your environment
+        File stream = /path/to/file.txt; // File | The template (file/inputstream) to store
+        try {
+            TemplateContextResponse result = apiInstance.uploadTemplateFile(templateId, stream);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling AllApi#uploadTemplateFile");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *templateId = templateId_example; // The template context name unique for your environment
+File *stream = /path/to/file.txt; // The template (file/inputstream) to store
+
+AllApi *apiInstance = [[AllApi alloc] init];
+
+// Upload template file
+[apiInstance uploadTemplateFileWith:templateId
+    stream:stream
+              completionHandler: ^(TemplateContextResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.AllApi()
+
+var templateId = templateId_example; // {String} The template context name unique for your environment
+
+var stream = /path/to/file.txt; // {File} The template (file/inputstream) to store
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.uploadTemplateFile(templateId, stream, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class uploadTemplateFileExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new AllApi();
+            var templateId = templateId_example;  // String | The template context name unique for your environment
+            var stream = new File(); // File | The template (file/inputstream) to store
+
+            try
+            {
+                // Upload template file
+                TemplateContextResponse result = apiInstance.uploadTemplateFile(templateId, stream);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling AllApi.uploadTemplateFile: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\AllApi();
+$templateId = templateId_example; // String | The template context name unique for your environment
+$stream = /path/to/file.txt; // File | The template (file/inputstream) to store
+
+try {
+    $result = $api_instance->uploadTemplateFile($templateId, $stream);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling AllApi->uploadTemplateFile: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::AllApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::AllApi->new();
+my $templateId = templateId_example; # String | The template context name unique for your environment
+my $stream = /path/to/file.txt; # File | The template (file/inputstream) to store
+
+eval { 
+    my $result = $api_instance->uploadTemplateFile(templateId => $templateId, stream => $stream);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling AllApi->uploadTemplateFile: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.AllApi()
+templateId = templateId_example # String | The template context name unique for your environment
+stream = /path/to/file.txt # File | The template (file/inputstream) to store
+
+try: 
+    # Upload template file
+    api_response = api_instance.upload_template_file(templateId, stream)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling AllApi->uploadTemplateFile: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
templateId* + + +
+
+
+ + String + + +
+ The template context name unique for your environment +
+
+
+ Required +
+
+
+
+ + + +
Form parameters
+ + + + + + + + + +
NameDescription
stream* + + +
+
+
+ + File + + +
+ The template (file/inputstream) to store +
+
+
+ Required +
+
+
+
+ + +

Responses

+

Status: 200 - Template uploaded and stored

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Template context not found

+ + + +
+
+
+ +
+ +
+
+ +

Status: 500 - Internal server error

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+

DataSet

+
+
+
+

createDataSet

+

Store dataset

+
+
+
+

+

Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job.

+

+
+
/datasets
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X POST "https://gw.api.cloud.sphereon.com/template/processor/0.1/datasets"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.DataSetApi;
+
+import java.io.File;
+import java.util.*;
+
+public class DataSetApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        DataSetApi apiInstance = new DataSetApi();
+        String payload = payload_example; // String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+        try {
+            DataSetResponse result = apiInstance.createDataSet(payload);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling DataSetApi#createDataSet");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.DataSetApi;
+
+public class DataSetApiExample {
+
+    public static void main(String[] args) {
+        DataSetApi apiInstance = new DataSetApi();
+        String payload = payload_example; // String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+        try {
+            DataSetResponse result = apiInstance.createDataSet(payload);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling DataSetApi#createDataSet");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *payload = payload_example; // The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+DataSetApi *apiInstance = [[DataSetApi alloc] init];
+
+// Store dataset
+[apiInstance createDataSetWith:payload
+              completionHandler: ^(DataSetResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.DataSetApi()
+
+var payload = payload_example; // {String} The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.createDataSet(payload, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class createDataSetExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new DataSetApi();
+            var payload = payload_example;  // String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+            try
+            {
+                // Store dataset
+                DataSetResponse result = apiInstance.createDataSet(payload);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling DataSetApi.createDataSet: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\DataSetApi();
+$payload = payload_example; // String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+try {
+    $result = $api_instance->createDataSet($payload);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling DataSetApi->createDataSet: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::DataSetApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::DataSetApi->new();
+my $payload = WWW::SwaggerClient::Object::String->new(); # String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+eval { 
+    my $result = $api_instance->createDataSet(payload => $payload);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling DataSetApi->createDataSet: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.DataSetApi()
+payload = payload_example # String | The dates for the merge
+[
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  },
+  {
+    "Field1": "Field1 value",
+    "Field2": "Field2 value",
+  }
+]
+
+try: 
+    # Store dataset
+    api_response = api_instance.create_data_set(payload)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling DataSetApi->createDataSet: %s\n" % e)
+
+
+ +

Parameters

+ + + +
Body parameters
+ + + + + + + + + +
NameDescription
payload * + + + +
+
+ + + +

Responses

+

Status: 200 - Data set received and stored

+ + + +
+
+
+ +
+ +
+
+ +

Status: 400 - Unsupported data set format

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

deleteDataSet

+

Delete a stored data set

+
+
+
+

+

Delete a stored data set

+

+
+
/datasets/{dataSetId}
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X DELETE "https://gw.api.cloud.sphereon.com/template/processor/0.1/datasets/{dataSetId}"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.DataSetApi;
+
+import java.io.File;
+import java.util.*;
+
+public class DataSetApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        DataSetApi apiInstance = new DataSetApi();
+        String dataSetId = dataSetId_example; // String | dataSetId
+        try {
+            DataSetResponse result = apiInstance.deleteDataSet(dataSetId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling DataSetApi#deleteDataSet");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.DataSetApi;
+
+public class DataSetApiExample {
+
+    public static void main(String[] args) {
+        DataSetApi apiInstance = new DataSetApi();
+        String dataSetId = dataSetId_example; // String | dataSetId
+        try {
+            DataSetResponse result = apiInstance.deleteDataSet(dataSetId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling DataSetApi#deleteDataSet");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *dataSetId = dataSetId_example; // dataSetId
+
+DataSetApi *apiInstance = [[DataSetApi alloc] init];
+
+// Delete a stored data set
+[apiInstance deleteDataSetWith:dataSetId
+              completionHandler: ^(DataSetResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.DataSetApi()
+
+var dataSetId = dataSetId_example; // {String} dataSetId
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.deleteDataSet(dataSetId, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class deleteDataSetExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new DataSetApi();
+            var dataSetId = dataSetId_example;  // String | dataSetId
+
+            try
+            {
+                // Delete a stored data set
+                DataSetResponse result = apiInstance.deleteDataSet(dataSetId);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling DataSetApi.deleteDataSet: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\DataSetApi();
+$dataSetId = dataSetId_example; // String | dataSetId
+
+try {
+    $result = $api_instance->deleteDataSet($dataSetId);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling DataSetApi->deleteDataSet: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::DataSetApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::DataSetApi->new();
+my $dataSetId = dataSetId_example; # String | dataSetId
+
+eval { 
+    my $result = $api_instance->deleteDataSet(dataSetId => $dataSetId);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling DataSetApi->deleteDataSet: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.DataSetApi()
+dataSetId = dataSetId_example # String | dataSetId
+
+try: 
+    # Delete a stored data set
+    api_response = api_instance.delete_data_set(dataSetId)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling DataSetApi->deleteDataSet: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
dataSetId* + + +
+
+
+ + String + + +
+ dataSetId +
+
+
+ Required +
+
+
+
+ + + + + +

Responses

+

Status: 200 - Successfully deleted the data set

+ + + +
+
+
+ +
+ +
+
+ +

Status: 400 - Could not delete data set

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Invalid data set id

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+

Job

+
+
+
+

getJob

+

Job definition and state

+
+
+
+

+

Get the merge job definition and current state. Please not that you can differentiate based on http response status

+

+
+
/jobs/{jobId}
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X GET "https://gw.api.cloud.sphereon.com/template/processor/0.1/jobs/{jobId}"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.JobApi;
+
+import java.io.File;
+import java.util.*;
+
+public class JobApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        JobApi apiInstance = new JobApi();
+        String jobId = jobId_example; // String | jobId
+        try {
+            MergeJobResponse result = apiInstance.getJob(jobId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling JobApi#getJob");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.JobApi;
+
+public class JobApiExample {
+
+    public static void main(String[] args) {
+        JobApi apiInstance = new JobApi();
+        String jobId = jobId_example; // String | jobId
+        try {
+            MergeJobResponse result = apiInstance.getJob(jobId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling JobApi#getJob");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *jobId = jobId_example; // jobId
+
+JobApi *apiInstance = [[JobApi alloc] init];
+
+// Job definition and state
+[apiInstance getJobWith:jobId
+              completionHandler: ^(MergeJobResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.JobApi()
+
+var jobId = jobId_example; // {String} jobId
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.getJob(jobId, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class getJobExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new JobApi();
+            var jobId = jobId_example;  // String | jobId
+
+            try
+            {
+                // Job definition and state
+                MergeJobResponse result = apiInstance.getJob(jobId);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling JobApi.getJob: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\JobApi();
+$jobId = jobId_example; // String | jobId
+
+try {
+    $result = $api_instance->getJob($jobId);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling JobApi->getJob: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::JobApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::JobApi->new();
+my $jobId = jobId_example; # String | jobId
+
+eval { 
+    my $result = $api_instance->getJob(jobId => $jobId);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling JobApi->getJob: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.JobApi()
+jobId = jobId_example # String | jobId
+
+try: 
+    # Job definition and state
+    api_response = api_instance.get_job(jobId)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling JobApi->getJob: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
jobId* + + +
+
+
+ + String + + +
+ jobId +
+
+
+ Required +
+
+
+
+ + + + + +

Responses

+

Status: 200 - Merge job returned and Job is done or in error

+ + + +
+
+
+ +
+ +
+
+ +

Status: 202 - Merge job returned and Job is still processing

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Invalid job id

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

getJobs

+

Get all jobs

+
+
+
+

+

Get all office text job definitions and their current state.

+

+
+
/jobs
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X GET "https://gw.api.cloud.sphereon.com/template/processor/0.1/jobs?status="
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.JobApi;
+
+import java.io.File;
+import java.util.*;
+
+public class JobApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        JobApi apiInstance = new JobApi();
+        array[String] status = ; // array[String] | A list of status to filter on.
+        try {
+            array[MergeJobResponse] result = apiInstance.getJobs(status);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling JobApi#getJobs");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.JobApi;
+
+public class JobApiExample {
+
+    public static void main(String[] args) {
+        JobApi apiInstance = new JobApi();
+        array[String] status = ; // array[String] | A list of status to filter on.
+        try {
+            array[MergeJobResponse] result = apiInstance.getJobs(status);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling JobApi#getJobs");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+array[String] *status = ; // A list of status to filter on. (optional)
+
+JobApi *apiInstance = [[JobApi alloc] init];
+
+// Get all jobs
+[apiInstance getJobsWith:status
+              completionHandler: ^(array[MergeJobResponse] output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.JobApi()
+
+var opts = { 
+  'status':  // {array[String]} A list of status to filter on.
+};
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.getJobs(opts, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class getJobsExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new JobApi();
+            var status = new array[String](); // array[String] | A list of status to filter on. (optional) 
+
+            try
+            {
+                // Get all jobs
+                array[MergeJobResponse] result = apiInstance.getJobs(status);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling JobApi.getJobs: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\JobApi();
+$status = ; // array[String] | A list of status to filter on.
+
+try {
+    $result = $api_instance->getJobs($status);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling JobApi->getJobs: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::JobApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::JobApi->new();
+my $status = []; # array[String] | A list of status to filter on.
+
+eval { 
+    my $result = $api_instance->getJobs(status => $status);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling JobApi->getJobs: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.JobApi()
+status =  # array[String] | A list of status to filter on. (optional)
+
+try: 
+    # Get all jobs
+    api_response = api_instance.get_jobs(status=status)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling JobApi->getJobs: %s\n" % e)
+
+
+ +

Parameters

+ + + + + +
Query parameters
+ + + + + + + + + +
NameDescription
status + + +
+
+
+ + array[String] + + +
+ A list of status to filter on. +
+
+
+
+
+ +

Responses

+

Status: 200 - All office text jobs that have not been deleted

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

getResultStream

+

Get the result file

+
+
+
+

+

Get a merge result document as a binary stream. +

+

+
+
/jobs/{jobId}/result/stream
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X PUT "https://gw.api.cloud.sphereon.com/template/processor/0.1/jobs/{jobId}/result/stream"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.JobApi;
+
+import java.io.File;
+import java.util.*;
+
+public class JobApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        JobApi apiInstance = new JobApi();
+        String jobId = jobId_example; // String | jobId
+        ResultStreamRequest resultStreamRequest = ; // ResultStreamRequest | resultStreamRequest
+        try {
+            byte[] result = apiInstance.getResultStream(jobId, resultStreamRequest);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling JobApi#getResultStream");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.JobApi;
+
+public class JobApiExample {
+
+    public static void main(String[] args) {
+        JobApi apiInstance = new JobApi();
+        String jobId = jobId_example; // String | jobId
+        ResultStreamRequest resultStreamRequest = ; // ResultStreamRequest | resultStreamRequest
+        try {
+            byte[] result = apiInstance.getResultStream(jobId, resultStreamRequest);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling JobApi#getResultStream");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *jobId = jobId_example; // jobId
+ResultStreamRequest *resultStreamRequest = ; // resultStreamRequest
+
+JobApi *apiInstance = [[JobApi alloc] init];
+
+// Get the result file
+[apiInstance getResultStreamWith:jobId
+    resultStreamRequest:resultStreamRequest
+              completionHandler: ^(byte[] output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.JobApi()
+
+var jobId = jobId_example; // {String} jobId
+
+var resultStreamRequest = ; // {ResultStreamRequest} resultStreamRequest
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.getResultStream(jobId, resultStreamRequest, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class getResultStreamExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new JobApi();
+            var jobId = jobId_example;  // String | jobId
+            var resultStreamRequest = new ResultStreamRequest(); // ResultStreamRequest | resultStreamRequest
+
+            try
+            {
+                // Get the result file
+                byte[] result = apiInstance.getResultStream(jobId, resultStreamRequest);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling JobApi.getResultStream: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\JobApi();
+$jobId = jobId_example; // String | jobId
+$resultStreamRequest = ; // ResultStreamRequest | resultStreamRequest
+
+try {
+    $result = $api_instance->getResultStream($jobId, $resultStreamRequest);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling JobApi->getResultStream: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::JobApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::JobApi->new();
+my $jobId = jobId_example; # String | jobId
+my $resultStreamRequest = WWW::SwaggerClient::Object::ResultStreamRequest->new(); # ResultStreamRequest | resultStreamRequest
+
+eval { 
+    my $result = $api_instance->getResultStream(jobId => $jobId, resultStreamRequest => $resultStreamRequest);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling JobApi->getResultStream: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.JobApi()
+jobId = jobId_example # String | jobId
+resultStreamRequest =  # ResultStreamRequest | resultStreamRequest
+
+try: 
+    # Get the result file
+    api_response = api_instance.get_result_stream(jobId, resultStreamRequest)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling JobApi->getResultStream: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
jobId* + + +
+
+
+ + String + + +
+ jobId +
+
+
+ Required +
+
+
+
+ + +
Body parameters
+ + + + + + + + + +
NameDescription
resultStreamRequest * + + + +
+
+ + + +

Responses

+

Status: 200 - Result file successfully returned

+ + + +
+
+
+ +
+ +
+
+ +

Status: 202 - Result file not yet created. Job is still executing.

+ + + +
+
+
+ +
+ +
+
+ +

Status: 400 - Result file could not be created.

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

getResultStreamsAsContainer

+

Get the result file

+
+
+
+

+

Get all documents inside a compressed container as a binary stream. +

+

+
+
/jobs/{jobId}/result/container
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X PUT "https://gw.api.cloud.sphereon.com/template/processor/0.1/jobs/{jobId}/result/container"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.JobApi;
+
+import java.io.File;
+import java.util.*;
+
+public class JobApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        JobApi apiInstance = new JobApi();
+        String jobId = jobId_example; // String | jobId
+        OutputSettings outputSettings = ; // OutputSettings | outputSettings
+        try {
+            byte[] result = apiInstance.getResultStreamsAsContainer(jobId, outputSettings);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling JobApi#getResultStreamsAsContainer");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.JobApi;
+
+public class JobApiExample {
+
+    public static void main(String[] args) {
+        JobApi apiInstance = new JobApi();
+        String jobId = jobId_example; // String | jobId
+        OutputSettings outputSettings = ; // OutputSettings | outputSettings
+        try {
+            byte[] result = apiInstance.getResultStreamsAsContainer(jobId, outputSettings);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling JobApi#getResultStreamsAsContainer");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *jobId = jobId_example; // jobId
+OutputSettings *outputSettings = ; // outputSettings (optional)
+
+JobApi *apiInstance = [[JobApi alloc] init];
+
+// Get the result file
+[apiInstance getResultStreamsAsContainerWith:jobId
+    outputSettings:outputSettings
+              completionHandler: ^(byte[] output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.JobApi()
+
+var jobId = jobId_example; // {String} jobId
+
+var opts = { 
+  'outputSettings':  // {OutputSettings} outputSettings
+};
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.getResultStreamsAsContainer(jobId, opts, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class getResultStreamsAsContainerExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new JobApi();
+            var jobId = jobId_example;  // String | jobId
+            var outputSettings = new OutputSettings(); // OutputSettings | outputSettings (optional) 
+
+            try
+            {
+                // Get the result file
+                byte[] result = apiInstance.getResultStreamsAsContainer(jobId, outputSettings);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling JobApi.getResultStreamsAsContainer: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\JobApi();
+$jobId = jobId_example; // String | jobId
+$outputSettings = ; // OutputSettings | outputSettings
+
+try {
+    $result = $api_instance->getResultStreamsAsContainer($jobId, $outputSettings);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling JobApi->getResultStreamsAsContainer: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::JobApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::JobApi->new();
+my $jobId = jobId_example; # String | jobId
+my $outputSettings = WWW::SwaggerClient::Object::OutputSettings->new(); # OutputSettings | outputSettings
+
+eval { 
+    my $result = $api_instance->getResultStreamsAsContainer(jobId => $jobId, outputSettings => $outputSettings);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling JobApi->getResultStreamsAsContainer: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.JobApi()
+jobId = jobId_example # String | jobId
+outputSettings =  # OutputSettings | outputSettings (optional)
+
+try: 
+    # Get the result file
+    api_response = api_instance.get_result_streams_as_container(jobId, outputSettings=outputSettings)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling JobApi->getResultStreamsAsContainer: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
jobId* + + +
+
+
+ + String + + +
+ jobId +
+
+
+ Required +
+
+
+
+ + +
Body parameters
+ + + + + + + + + +
NameDescription
outputSettings + + + +
+
+ + + +

Responses

+

Status: 200 - Result package successfully created and returned

+ + + +
+
+
+ +
+ +
+
+ +

Status: 202 - Result file not yet created. Job is still executing.

+ + + +
+
+
+ +
+ +
+
+ +

Status: 400 - Result file could not be created.

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

submitJob

+

Submit merge job for processing

+
+
+
+

+

Submit merge job run.

+

+
+
/jobs
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X PUT "https://gw.api.cloud.sphereon.com/template/processor/0.1/jobs"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.JobApi;
+
+import java.io.File;
+import java.util.*;
+
+public class JobApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        JobApi apiInstance = new JobApi();
+        MergeSettings mergesettings = ; // MergeSettings | The merge- and output settings
+        try {
+            MergeJobResponse result = apiInstance.submitJob(mergesettings);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling JobApi#submitJob");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.JobApi;
+
+public class JobApiExample {
+
+    public static void main(String[] args) {
+        JobApi apiInstance = new JobApi();
+        MergeSettings mergesettings = ; // MergeSettings | The merge- and output settings
+        try {
+            MergeJobResponse result = apiInstance.submitJob(mergesettings);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling JobApi#submitJob");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+MergeSettings *mergesettings = ; // The merge- and output settings
+
+JobApi *apiInstance = [[JobApi alloc] init];
+
+// Submit merge job for processing
+[apiInstance submitJobWith:mergesettings
+              completionHandler: ^(MergeJobResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.JobApi()
+
+var mergesettings = ; // {MergeSettings} The merge- and output settings
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.submitJob(mergesettings, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class submitJobExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new JobApi();
+            var mergesettings = new MergeSettings(); // MergeSettings | The merge- and output settings
+
+            try
+            {
+                // Submit merge job for processing
+                MergeJobResponse result = apiInstance.submitJob(mergesettings);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling JobApi.submitJob: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\JobApi();
+$mergesettings = ; // MergeSettings | The merge- and output settings
+
+try {
+    $result = $api_instance->submitJob($mergesettings);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling JobApi->submitJob: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::JobApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::JobApi->new();
+my $mergesettings = WWW::SwaggerClient::Object::MergeSettings->new(); # MergeSettings | The merge- and output settings
+
+eval { 
+    my $result = $api_instance->submitJob(mergesettings => $mergesettings);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling JobApi->submitJob: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.JobApi()
+mergesettings =  # MergeSettings | The merge- and output settings
+
+try: 
+    # Submit merge job for processing
+    api_response = api_instance.submit_job(mergesettings)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling JobApi->submitJob: %s\n" % e)
+
+
+ +

Parameters

+ + + +
Body parameters
+ + + + + + + + + +
NameDescription
mergesettings * + + + +
+
+ + + +

Responses

+

Status: 200 - Merge job submitted

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+

Template

+
+
+
+

createTemplateContext

+

Create template context

+
+
+
+

+

Create a unique template context for your environment

+

+
+
/templates
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X POST "https://gw.api.cloud.sphereon.com/template/processor/0.1/templates"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.TemplateApi;
+
+import java.io.File;
+import java.util.*;
+
+public class TemplateApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        TemplateApi apiInstance = new TemplateApi();
+        TemplateContextRequest templateRequest = ; // TemplateContextRequest | The template request
+        try {
+            TemplateContextResponse result = apiInstance.createTemplateContext(templateRequest);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling TemplateApi#createTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.TemplateApi;
+
+public class TemplateApiExample {
+
+    public static void main(String[] args) {
+        TemplateApi apiInstance = new TemplateApi();
+        TemplateContextRequest templateRequest = ; // TemplateContextRequest | The template request
+        try {
+            TemplateContextResponse result = apiInstance.createTemplateContext(templateRequest);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling TemplateApi#createTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+TemplateContextRequest *templateRequest = ; // The template request
+
+TemplateApi *apiInstance = [[TemplateApi alloc] init];
+
+// Create template context
+[apiInstance createTemplateContextWith:templateRequest
+              completionHandler: ^(TemplateContextResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.TemplateApi()
+
+var templateRequest = ; // {TemplateContextRequest} The template request
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.createTemplateContext(templateRequest, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class createTemplateContextExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new TemplateApi();
+            var templateRequest = new TemplateContextRequest(); // TemplateContextRequest | The template request
+
+            try
+            {
+                // Create template context
+                TemplateContextResponse result = apiInstance.createTemplateContext(templateRequest);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling TemplateApi.createTemplateContext: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\TemplateApi();
+$templateRequest = ; // TemplateContextRequest | The template request
+
+try {
+    $result = $api_instance->createTemplateContext($templateRequest);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling TemplateApi->createTemplateContext: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::TemplateApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::TemplateApi->new();
+my $templateRequest = WWW::SwaggerClient::Object::TemplateContextRequest->new(); # TemplateContextRequest | The template request
+
+eval { 
+    my $result = $api_instance->createTemplateContext(templateRequest => $templateRequest);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling TemplateApi->createTemplateContext: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.TemplateApi()
+templateRequest =  # TemplateContextRequest | The template request
+
+try: 
+    # Create template context
+    api_response = api_instance.create_template_context(templateRequest)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling TemplateApi->createTemplateContext: %s\n" % e)
+
+
+ +

Parameters

+ + + +
Body parameters
+ + + + + + + + + +
NameDescription
templateRequest * + + + +
+
+ + + +

Responses

+

Status: 200 - Template context created

+ + + +
+
+
+ +
+ +
+
+ +

Status: 400 - Template context already exists

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

deleteTemplateContext

+

Delete template context

+
+
+
+

+

Delete a template context with all history

+

+
+
/templates/{templateId}
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X DELETE "https://gw.api.cloud.sphereon.com/template/processor/0.1/templates/{templateId}"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.TemplateApi;
+
+import java.io.File;
+import java.util.*;
+
+public class TemplateApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        TemplateApi apiInstance = new TemplateApi();
+        String templateId = templateId_example; // String | templateId
+        try {
+            TemplateContextResponse result = apiInstance.deleteTemplateContext(templateId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling TemplateApi#deleteTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.TemplateApi;
+
+public class TemplateApiExample {
+
+    public static void main(String[] args) {
+        TemplateApi apiInstance = new TemplateApi();
+        String templateId = templateId_example; // String | templateId
+        try {
+            TemplateContextResponse result = apiInstance.deleteTemplateContext(templateId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling TemplateApi#deleteTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *templateId = templateId_example; // templateId
+
+TemplateApi *apiInstance = [[TemplateApi alloc] init];
+
+// Delete template context
+[apiInstance deleteTemplateContextWith:templateId
+              completionHandler: ^(TemplateContextResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.TemplateApi()
+
+var templateId = templateId_example; // {String} templateId
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.deleteTemplateContext(templateId, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class deleteTemplateContextExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new TemplateApi();
+            var templateId = templateId_example;  // String | templateId
+
+            try
+            {
+                // Delete template context
+                TemplateContextResponse result = apiInstance.deleteTemplateContext(templateId);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling TemplateApi.deleteTemplateContext: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\TemplateApi();
+$templateId = templateId_example; // String | templateId
+
+try {
+    $result = $api_instance->deleteTemplateContext($templateId);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling TemplateApi->deleteTemplateContext: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::TemplateApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::TemplateApi->new();
+my $templateId = templateId_example; # String | templateId
+
+eval { 
+    my $result = $api_instance->deleteTemplateContext(templateId => $templateId);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling TemplateApi->deleteTemplateContext: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.TemplateApi()
+templateId = templateId_example # String | templateId
+
+try: 
+    # Delete template context
+    api_response = api_instance.delete_template_context(templateId)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling TemplateApi->deleteTemplateContext: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
templateId* + + +
+
+
+ + String + + +
+ templateId +
+
+
+ Required +
+
+
+
+ + + + + +

Responses

+

Status: 200 - Template context deleted

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Template context not found

+ + + +
+
+
+ +
+ +
+
+ +

Status: 500 - Internal server error

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

getTemplateContext

+

Get template context

+
+
+
+

+

Get an existing template context

+

+
+
/templates/{templateId}
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X GET "https://gw.api.cloud.sphereon.com/template/processor/0.1/templates/{templateId}"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.TemplateApi;
+
+import java.io.File;
+import java.util.*;
+
+public class TemplateApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        TemplateApi apiInstance = new TemplateApi();
+        String templateId = templateId_example; // String | The template context name unique for your environment
+        try {
+            TemplateContextResponse result = apiInstance.getTemplateContext(templateId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling TemplateApi#getTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.TemplateApi;
+
+public class TemplateApiExample {
+
+    public static void main(String[] args) {
+        TemplateApi apiInstance = new TemplateApi();
+        String templateId = templateId_example; // String | The template context name unique for your environment
+        try {
+            TemplateContextResponse result = apiInstance.getTemplateContext(templateId);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling TemplateApi#getTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *templateId = templateId_example; // The template context name unique for your environment
+
+TemplateApi *apiInstance = [[TemplateApi alloc] init];
+
+// Get template context
+[apiInstance getTemplateContextWith:templateId
+              completionHandler: ^(TemplateContextResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.TemplateApi()
+
+var templateId = templateId_example; // {String} The template context name unique for your environment
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.getTemplateContext(templateId, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class getTemplateContextExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new TemplateApi();
+            var templateId = templateId_example;  // String | The template context name unique for your environment
+
+            try
+            {
+                // Get template context
+                TemplateContextResponse result = apiInstance.getTemplateContext(templateId);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling TemplateApi.getTemplateContext: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\TemplateApi();
+$templateId = templateId_example; // String | The template context name unique for your environment
+
+try {
+    $result = $api_instance->getTemplateContext($templateId);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling TemplateApi->getTemplateContext: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::TemplateApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::TemplateApi->new();
+my $templateId = templateId_example; # String | The template context name unique for your environment
+
+eval { 
+    my $result = $api_instance->getTemplateContext(templateId => $templateId);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling TemplateApi->getTemplateContext: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.TemplateApi()
+templateId = templateId_example # String | The template context name unique for your environment
+
+try: 
+    # Get template context
+    api_response = api_instance.get_template_context(templateId)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling TemplateApi->getTemplateContext: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
templateId* + + +
+
+
+ + String + + +
+ The template context name unique for your environment +
+
+
+ Required +
+
+
+
+ + + + + +

Responses

+

Status: 200 - Template context found

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Template context not found

+ + + +
+
+
+ +
+ +
+
+ +

Status: 500 - Internal server error

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

updateTemplateContext

+

Update template context

+
+
+
+

+

Update an existing template context for your environment

+

+
+
/templates
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X PUT "https://gw.api.cloud.sphereon.com/template/processor/0.1/templates"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.TemplateApi;
+
+import java.io.File;
+import java.util.*;
+
+public class TemplateApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        TemplateApi apiInstance = new TemplateApi();
+        TemplateContext templateContext = ; // TemplateContext | templateContext
+        try {
+            TemplateContextResponse result = apiInstance.updateTemplateContext(templateContext);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling TemplateApi#updateTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.TemplateApi;
+
+public class TemplateApiExample {
+
+    public static void main(String[] args) {
+        TemplateApi apiInstance = new TemplateApi();
+        TemplateContext templateContext = ; // TemplateContext | templateContext
+        try {
+            TemplateContextResponse result = apiInstance.updateTemplateContext(templateContext);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling TemplateApi#updateTemplateContext");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+TemplateContext *templateContext = ; // templateContext
+
+TemplateApi *apiInstance = [[TemplateApi alloc] init];
+
+// Update template context
+[apiInstance updateTemplateContextWith:templateContext
+              completionHandler: ^(TemplateContextResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.TemplateApi()
+
+var templateContext = ; // {TemplateContext} templateContext
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.updateTemplateContext(templateContext, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class updateTemplateContextExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new TemplateApi();
+            var templateContext = new TemplateContext(); // TemplateContext | templateContext
+
+            try
+            {
+                // Update template context
+                TemplateContextResponse result = apiInstance.updateTemplateContext(templateContext);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling TemplateApi.updateTemplateContext: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\TemplateApi();
+$templateContext = ; // TemplateContext | templateContext
+
+try {
+    $result = $api_instance->updateTemplateContext($templateContext);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling TemplateApi->updateTemplateContext: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::TemplateApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::TemplateApi->new();
+my $templateContext = WWW::SwaggerClient::Object::TemplateContext->new(); # TemplateContext | templateContext
+
+eval { 
+    my $result = $api_instance->updateTemplateContext(templateContext => $templateContext);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling TemplateApi->updateTemplateContext: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.TemplateApi()
+templateContext =  # TemplateContext | templateContext
+
+try: 
+    # Update template context
+    api_response = api_instance.update_template_context(templateContext)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling TemplateApi->updateTemplateContext: %s\n" % e)
+
+
+ +

Parameters

+ + + +
Body parameters
+ + + + + + + + + +
NameDescription
templateContext * + + + +
+
+ + + +

Responses

+

Status: 200 - Template context updated

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Template context not found

+ + + +
+
+
+ +
+ +
+
+ +

Status: 500 - Internal server error

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+

uploadTemplateFile

+

Upload template file

+
+
+
+

+

Upload the Office template file

+

+
+
/templates/{templateId}
+

+

Usage and SDK Samples

+

+ + +
+
+
curl -X POST "https://gw.api.cloud.sphereon.com/template/processor/0.1/templates/{templateId}"
+
+
+
import com.sphereon.sdk.template-processor.*;
+import com.sphereon.sdk.template-processor.auth.*;
+import com.sphereon.sdk.template-processor.model.*;
+import com.sphereon.sdk.template-processor.api.TemplateApi;
+
+import java.io.File;
+import java.util.*;
+
+public class TemplateApiExample {
+
+    public static void main(String[] args) {
+        ApiClient defaultClient = Configuration.getDefaultApiClient();
+        
+        // Configure OAuth2 access token for authorization: oauth2schema
+        OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema");
+        oauth2schema.setAccessToken("YOUR ACCESS TOKEN");
+
+        TemplateApi apiInstance = new TemplateApi();
+        String templateId = templateId_example; // String | The template context name unique for your environment
+        File stream = /path/to/file.txt; // File | The template (file/inputstream) to store
+        try {
+            TemplateContextResponse result = apiInstance.uploadTemplateFile(templateId, stream);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling TemplateApi#uploadTemplateFile");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
import com.sphereon.sdk.template-processor.api.TemplateApi;
+
+public class TemplateApiExample {
+
+    public static void main(String[] args) {
+        TemplateApi apiInstance = new TemplateApi();
+        String templateId = templateId_example; // String | The template context name unique for your environment
+        File stream = /path/to/file.txt; // File | The template (file/inputstream) to store
+        try {
+            TemplateContextResponse result = apiInstance.uploadTemplateFile(templateId, stream);
+            System.out.println(result);
+        } catch (ApiException e) {
+            System.err.println("Exception when calling TemplateApi#uploadTemplateFile");
+            e.printStackTrace();
+        }
+    }
+}
+
+ +
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure OAuth2 access token for authorization: (authentication scheme: oauth2schema)
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+String *templateId = templateId_example; // The template context name unique for your environment
+File *stream = /path/to/file.txt; // The template (file/inputstream) to store
+
+TemplateApi *apiInstance = [[TemplateApi alloc] init];
+
+// Upload template file
+[apiInstance uploadTemplateFileWith:templateId
+    stream:stream
+              completionHandler: ^(TemplateContextResponse output, NSError* error) {
+                            if (output) {
+                                NSLog(@"%@", output);
+                            }
+                            if (error) {
+                                NSLog(@"Error: %@", error);
+                            }
+                        }];
+
+
+ +
+
var TemplateProcessor = require('template_processor');
+var defaultClient = TemplateProcessor.ApiClient.instance;
+
+// Configure OAuth2 access token for authorization: oauth2schema
+var oauth2schema = defaultClient.authentications['oauth2schema'];
+oauth2schema.accessToken = "YOUR ACCESS TOKEN"
+
+var api = new TemplateProcessor.TemplateApi()
+
+var templateId = templateId_example; // {String} The template context name unique for your environment
+
+var stream = /path/to/file.txt; // {File} The template (file/inputstream) to store
+
+
+var callback = function(error, data, response) {
+  if (error) {
+    console.error(error);
+  } else {
+    console.log('API called successfully. Returned data: ' + data);
+  }
+};
+api.uploadTemplateFile(templateId, stream, callback);
+
+
+ + +
+
using System;
+using System.Diagnostics;
+using IO.Swagger.Api;
+using IO.Swagger.Client;
+using IO.Swagger.Model;
+
+namespace Example
+{
+    public class uploadTemplateFileExample
+    {
+        public void main()
+        {
+            
+            // Configure OAuth2 access token for authorization: oauth2schema
+            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+            var apiInstance = new TemplateApi();
+            var templateId = templateId_example;  // String | The template context name unique for your environment
+            var stream = new File(); // File | The template (file/inputstream) to store
+
+            try
+            {
+                // Upload template file
+                TemplateContextResponse result = apiInstance.uploadTemplateFile(templateId, stream);
+                Debug.WriteLine(result);
+            }
+            catch (Exception e)
+            {
+                Debug.Print("Exception when calling TemplateApi.uploadTemplateFile: " + e.Message );
+            }
+        }
+    }
+}
+
+
+ +
+
<?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure OAuth2 access token for authorization: oauth2schema
+Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+
+$api_instance = new Swagger\Client\Api\TemplateApi();
+$templateId = templateId_example; // String | The template context name unique for your environment
+$stream = /path/to/file.txt; // File | The template (file/inputstream) to store
+
+try {
+    $result = $api_instance->uploadTemplateFile($templateId, $stream);
+    print_r($result);
+} catch (Exception $e) {
+    echo 'Exception when calling TemplateApi->uploadTemplateFile: ', $e->getMessage(), PHP_EOL;
+}
+?>
+
+ +
+
use Data::Dumper;
+use WWW::SwaggerClient::Configuration;
+use WWW::SwaggerClient::TemplateApi;
+
+# Configure OAuth2 access token for authorization: oauth2schema
+$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+my $api_instance = WWW::SwaggerClient::TemplateApi->new();
+my $templateId = templateId_example; # String | The template context name unique for your environment
+my $stream = /path/to/file.txt; # File | The template (file/inputstream) to store
+
+eval { 
+    my $result = $api_instance->uploadTemplateFile(templateId => $templateId, stream => $stream);
+    print Dumper($result);
+};
+if ($@) {
+    warn "Exception when calling TemplateApi->uploadTemplateFile: $@\n";
+}
+
+ +
+
from __future__ import print_statement
+import time
+import swagger_client
+from swagger_client.rest import ApiException
+from pprint import pprint
+
+# Configure OAuth2 access token for authorization: oauth2schema
+swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# create an instance of the API class
+api_instance = swagger_client.TemplateApi()
+templateId = templateId_example # String | The template context name unique for your environment
+stream = /path/to/file.txt # File | The template (file/inputstream) to store
+
+try: 
+    # Upload template file
+    api_response = api_instance.upload_template_file(templateId, stream)
+    pprint(api_response)
+except ApiException as e:
+    print("Exception when calling TemplateApi->uploadTemplateFile: %s\n" % e)
+
+
+ +

Parameters

+ +
Path parameters
+ + + + + + + + + +
NameDescription
templateId* + + +
+
+
+ + String + + +
+ The template context name unique for your environment +
+
+
+ Required +
+
+
+
+ + + +
Form parameters
+ + + + + + + + + +
NameDescription
stream* + + +
+
+
+ + File + + +
+ The template (file/inputstream) to store +
+
+
+ Required +
+
+
+
+ + +

Responses

+

Status: 200 - Template uploaded and stored

+ + + +
+
+
+ +
+ +
+
+ +

Status: 404 - Template context not found

+ + + +
+
+
+ +
+ +
+
+ +

Status: 500 - Internal server error

+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+
+ +
+
+ Generated 2019-02-05T11:54:42.554+01:00 +
+
+
+
+
+ + + + + + + + + + + + + + diff --git a/java8/.gitignore b/java8-jersey2/.gitignore similarity index 100% rename from java8/.gitignore rename to java8-jersey2/.gitignore diff --git a/java8-jersey2/.swagger-codegen-ignore b/java8-jersey2/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/java8-jersey2/.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/java8-jersey2/.swagger-codegen/VERSION b/java8-jersey2/.swagger-codegen/VERSION new file mode 100644 index 0000000..a625450 --- /dev/null +++ b/java8-jersey2/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/java8-jersey2/.travis.yml b/java8-jersey2/.travis.yml new file mode 100644 index 0000000..70cb81a --- /dev/null +++ b/java8-jersey2/.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/java8-jersey2/README.md b/java8-jersey2/README.md new file mode 100644 index 0000000..3f5c749 --- /dev/null +++ b/java8-jersey2/README.md @@ -0,0 +1,163 @@ +# template-processor-sdk-java8-jersey2 + +## Requirements + +Building the API client library requires [Maven](https://maven.apache.org/) to be installed. + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn deploy +``` + +Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + com.sphereon.sdk + template-processor-sdk-java8-jersey2 + 0.1.1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "com.sphereon.sdk:template-processor-sdk-java8-jersey2:0.1.1" +``` + +### Others + +At first generate the JAR by executing: + + mvn package + +Then manually install the following JARs: + +* target/template-processor-sdk-java8-jersey2-0.1.1.jar +* target/lib/*.jar + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import com.sphereon.sdk.template_processor.handler.*; +import com.sphereon.sdk.template_processor.handler.auth.*; +import com.sphereon.sdk.template_processor.model.*; +import com.sphereon.sdk.template_processor.api.AllApi; + +import java.io.File; +import java.util.*; + +public class AllApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure OAuth2 access token for authorization: oauth2schema + OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); + oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); + + AllApi apiInstance = new AllApi(); + String payload = "payload_example"; // String | The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] + try { + DataSetResponse result = apiInstance.createDataSet(payload); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AllApi#createDataSet"); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://gw.api.cloud.sphereon.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AllApi* | [**createDataSet**](docs/AllApi.md#createDataSet) | **POST** /template/processor/0.1/datasets | Store dataset +*AllApi* | [**createTemplateContext**](docs/AllApi.md#createTemplateContext) | **POST** /template/processor/0.1/templates | Create template context +*AllApi* | [**deleteDataSet**](docs/AllApi.md#deleteDataSet) | **DELETE** /template/processor/0.1/datasets/{dataSetId} | Delete a stored data set +*AllApi* | [**deleteJob**](docs/AllApi.md#deleteJob) | **DELETE** /template/processor/0.1/jobs/{jobId} | Delete a job manually +*AllApi* | [**deleteTemplateContext**](docs/AllApi.md#deleteTemplateContext) | **DELETE** /template/processor/0.1/templates/{templateId} | Delete template context +*AllApi* | [**getJob**](docs/AllApi.md#getJob) | **GET** /template/processor/0.1/jobs/{jobId} | Job definition and state +*AllApi* | [**getJobs**](docs/AllApi.md#getJobs) | **GET** /template/processor/0.1/jobs | Get all jobs +*AllApi* | [**getResultStream**](docs/AllApi.md#getResultStream) | **PUT** /template/processor/0.1/jobs/{jobId}/result/stream | Get the result file +*AllApi* | [**getResultStreamsAsContainer**](docs/AllApi.md#getResultStreamsAsContainer) | **PUT** /template/processor/0.1/jobs/{jobId}/result/container | Get the result file +*AllApi* | [**getTemplateContext**](docs/AllApi.md#getTemplateContext) | **GET** /template/processor/0.1/templates/{templateId} | Get template context +*AllApi* | [**submitJob**](docs/AllApi.md#submitJob) | **PUT** /template/processor/0.1/jobs | Submit merge job for processing +*AllApi* | [**updateTemplateContext**](docs/AllApi.md#updateTemplateContext) | **PUT** /template/processor/0.1/templates | Update template context +*AllApi* | [**uploadTemplateFile**](docs/AllApi.md#uploadTemplateFile) | **POST** /template/processor/0.1/templates/{templateId} | Upload template file +*DataSetApi* | [**createDataSet**](docs/DataSetApi.md#createDataSet) | **POST** /template/processor/0.1/datasets | Store dataset +*DataSetApi* | [**deleteDataSet**](docs/DataSetApi.md#deleteDataSet) | **DELETE** /template/processor/0.1/datasets/{dataSetId} | Delete a stored data set +*JobApi* | [**getJob**](docs/JobApi.md#getJob) | **GET** /template/processor/0.1/jobs/{jobId} | Job definition and state +*JobApi* | [**getJobs**](docs/JobApi.md#getJobs) | **GET** /template/processor/0.1/jobs | Get all jobs +*JobApi* | [**getResultStream**](docs/JobApi.md#getResultStream) | **PUT** /template/processor/0.1/jobs/{jobId}/result/stream | Get the result file +*JobApi* | [**getResultStreamsAsContainer**](docs/JobApi.md#getResultStreamsAsContainer) | **PUT** /template/processor/0.1/jobs/{jobId}/result/container | Get the result file +*JobApi* | [**submitJob**](docs/JobApi.md#submitJob) | **PUT** /template/processor/0.1/jobs | Submit merge job for processing +*TemplateApi* | [**createTemplateContext**](docs/TemplateApi.md#createTemplateContext) | **POST** /template/processor/0.1/templates | Create template context +*TemplateApi* | [**deleteTemplateContext**](docs/TemplateApi.md#deleteTemplateContext) | **DELETE** /template/processor/0.1/templates/{templateId} | Delete template context +*TemplateApi* | [**getTemplateContext**](docs/TemplateApi.md#getTemplateContext) | **GET** /template/processor/0.1/templates/{templateId} | Get template context +*TemplateApi* | [**updateTemplateContext**](docs/TemplateApi.md#updateTemplateContext) | **PUT** /template/processor/0.1/templates | Update template context +*TemplateApi* | [**uploadTemplateFile**](docs/TemplateApi.md#uploadTemplateFile) | **POST** /template/processor/0.1/templates/{templateId} | Upload template file + + +## Documentation for Models + + - [DataSetResponse](docs/DataSetResponse.md) + - [Error](docs/Error.md) + - [ErrorResponse](docs/ErrorResponse.md) + - [Lifecycle](docs/Lifecycle.md) + - [MergeJob](docs/MergeJob.md) + - [MergeJobResponse](docs/MergeJobResponse.md) + - [MergeSettings](docs/MergeSettings.md) + - [OutputSettings](docs/OutputSettings.md) + - [OwnerInfo](docs/OwnerInfo.md) + - [ResultStreamRequest](docs/ResultStreamRequest.md) + - [StorageLocation](docs/StorageLocation.md) + - [StreamLocation](docs/StreamLocation.md) + - [TemplateContext](docs/TemplateContext.md) + - [TemplateContextRequest](docs/TemplateContextRequest.md) + - [TemplateContextResponse](docs/TemplateContextResponse.md) + + +## Documentation for Authorization + +Authentication schemes defined for the API: +### oauth2schema + +- **Type**: OAuth +- **Flow**: application +- **Authorization URL**: +- **Scopes**: + - global: accessEverything + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + +dev@sphereon.com + diff --git a/java8-jersey2/build.gradle b/java8-jersey2/build.gradle new file mode 100644 index 0000000..34e4c40 --- /dev/null +++ b/java8-jersey2/build.gradle @@ -0,0 +1,112 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'com.sphereon.sdk' +version = '0.1.1' + +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_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // 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_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + install { + repositories.mavenInstaller { + pom.artifactId = 'template-processor-sdk-java8-jersey2' + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + swagger_annotations_version = "1.5.15" + jackson_version = "2.8.9" + jersey_version = "2.25.1" + junit_version = "4.12" +} + +dependencies { + compile "io.swagger:swagger-annotations:$swagger_annotations_version" + compile "org.glassfish.jersey.core:jersey-client:$jersey_version" + compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" + compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" + compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + testCompile "junit:junit:$junit_version" +} diff --git a/java8-jersey2/build.sbt b/java8-jersey2/build.sbt new file mode 100644 index 0000000..9c53006 --- /dev/null +++ b/java8-jersey2/build.sbt @@ -0,0 +1,24 @@ +lazy val root = (project in file(".")). + settings( + organization := "com.sphereon.sdk", + name := "template-processor-sdk-java8-jersey2", + version := "0.1.1", + 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" % "swagger-annotations" % "1.5.15", + "org.glassfish.jersey.core" % "jersey-client" % "2.25.1", + "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1", + "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1", + "com.fasterxml.jackson.core" % "jackson-core" % "2.8.9", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.9", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.9", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.8.9", + "com.brsanthu" % "migbase64" % "2.2", + "junit" % "junit" % "4.12" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/java8/git_push.sh b/java8-jersey2/git_push.sh similarity index 96% rename from java8/git_push.sh rename to java8-jersey2/git_push.sh index ed37461..ae01b18 100644 --- a/java8/git_push.sh +++ b/java8-jersey2/git_push.sh @@ -36,7 +36,7 @@ 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." + 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 diff --git a/java8/gradle.properties b/java8-jersey2/gradle.properties similarity index 100% rename from java8/gradle.properties rename to java8-jersey2/gradle.properties diff --git a/java8/gradle/wrapper/gradle-wrapper.jar b/java8-jersey2/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from java8/gradle/wrapper/gradle-wrapper.jar rename to java8-jersey2/gradle/wrapper/gradle-wrapper.jar diff --git a/java8/gradle/wrapper/gradle-wrapper.properties b/java8-jersey2/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from java8/gradle/wrapper/gradle-wrapper.properties rename to java8-jersey2/gradle/wrapper/gradle-wrapper.properties diff --git a/java8/gradlew b/java8-jersey2/gradlew similarity index 100% rename from java8/gradlew rename to java8-jersey2/gradlew diff --git a/java8/gradlew.bat b/java8-jersey2/gradlew.bat similarity index 100% rename from java8/gradlew.bat rename to java8-jersey2/gradlew.bat diff --git a/java8-jersey2/pom.xml b/java8-jersey2/pom.xml new file mode 100644 index 0000000..7a1158e --- /dev/null +++ b/java8-jersey2/pom.xml @@ -0,0 +1,260 @@ + + 4.0.0 + com.sphereon.sdk + template-processor-sdk-java8-jersey2 + jar + template-processor-sdk-java8-jersey2 + 0.1.2 + 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 + + + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + + 1.8 + 1.8 + + + + 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 + swagger-annotations + ${swagger-core-version} + + + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.5.15 + 2.25.1 + 2.7.5 + 1.0.0 + 4.12 + + diff --git a/java8-jersey2/settings.gradle b/java8-jersey2/settings.gradle new file mode 100644 index 0000000..006a9e3 --- /dev/null +++ b/java8-jersey2/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "template-processor-sdk-java8-jersey2" \ No newline at end of file diff --git a/java8/src/test/java/com/sphereon/sdk/template/processor/api/AllApiTest.java b/java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/AllApiTest.java similarity index 69% rename from java8/src/test/java/com/sphereon/sdk/template/processor/api/AllApiTest.java rename to java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/AllApiTest.java index 09a8bcf..95138fd 100644 --- a/java8/src/test/java/com/sphereon/sdk/template/processor/api/AllApiTest.java +++ b/java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/AllApiTest.java @@ -1,4 +1,4 @@ -/** +/* * Template-Processor * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store * @@ -8,33 +8,24 @@ * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ -package com.sphereon.sdk.template.processor.api; +package com.sphereon.sdk.template_processor.api; -import com.sphereon.sdk.template.processor.handler.ApiException; -import com.sphereon.sdk.template.processor.model.DataSetResponse; -import com.sphereon.sdk.template.processor.model.ErrorResponse; -import com.sphereon.sdk.template.processor.model.TemplateContextResponse; -import com.sphereon.sdk.template.processor.model.TemplateContextRequest; -import com.sphereon.sdk.template.processor.model.MergeJobResponse; -import com.sphereon.sdk.template.processor.model.OutputSettings; -import com.sphereon.sdk.template.processor.model.MergeSettings; +import com.sphereon.sdk.template_processor.handler.ApiException; +import com.sphereon.sdk.template_processor.model.DataSetResponse; +import com.sphereon.sdk.template_processor.model.ErrorResponse; import java.io.File; +import com.sphereon.sdk.template_processor.model.MergeJobResponse; +import com.sphereon.sdk.template_processor.model.MergeSettings; +import com.sphereon.sdk.template_processor.model.OutputSettings; +import com.sphereon.sdk.template_processor.model.ResultStreamRequest; +import com.sphereon.sdk.template_processor.model.TemplateContext; +import com.sphereon.sdk.template_processor.model.TemplateContextRequest; +import com.sphereon.sdk.template_processor.model.TemplateContextResponse; import org.junit.Test; +import org.junit.Ignore; import java.util.ArrayList; import java.util.HashMap; @@ -44,6 +35,7 @@ /** * API tests for AllApi */ +@Ignore public class AllApiTest { private final AllApi api = new AllApi(); @@ -60,7 +52,7 @@ public class AllApiTest { @Test public void createDataSetTest() throws ApiException { String payload = null; - // DataSetResponse response = api.createDataSet(payload); + DataSetResponse response = api.createDataSet(payload); // TODO: test validations } @@ -76,7 +68,7 @@ public void createDataSetTest() throws ApiException { @Test public void createTemplateContextTest() throws ApiException { TemplateContextRequest templateRequest = null; - // TemplateContextResponse response = api.createTemplateContext(templateRequest); + TemplateContextResponse response = api.createTemplateContext(templateRequest); // TODO: test validations } @@ -92,7 +84,7 @@ public void createTemplateContextTest() throws ApiException { @Test public void deleteDataSetTest() throws ApiException { String dataSetId = null; - // DataSetResponse response = api.deleteDataSet(dataSetId); + DataSetResponse response = api.deleteDataSet(dataSetId); // TODO: test validations } @@ -108,7 +100,7 @@ public void deleteDataSetTest() throws ApiException { @Test public void deleteJobTest() throws ApiException { String jobId = null; - // MergeJobResponse response = api.deleteJob(jobId); + MergeJobResponse response = api.deleteJob(jobId); // TODO: test validations } @@ -124,7 +116,7 @@ public void deleteJobTest() throws ApiException { @Test public void deleteTemplateContextTest() throws ApiException { String templateId = null; - // TemplateContextResponse response = api.deleteTemplateContext(templateId); + TemplateContextResponse response = api.deleteTemplateContext(templateId); // TODO: test validations } @@ -140,7 +132,7 @@ public void deleteTemplateContextTest() throws ApiException { @Test public void getJobTest() throws ApiException { String jobId = null; - // MergeJobResponse response = api.getJob(jobId); + MergeJobResponse response = api.getJob(jobId); // TODO: test validations } @@ -156,7 +148,7 @@ public void getJobTest() throws ApiException { @Test public void getJobsTest() throws ApiException { List status = null; - // List response = api.getJobs(status); + List response = api.getJobs(status); // TODO: test validations } @@ -170,11 +162,10 @@ public void getJobsTest() throws ApiException { * if the Api call fails */ @Test - public void getResultStreamByIdTest() throws ApiException { + public void getResultStreamTest() throws ApiException { String jobId = null; - String streamId = null; - OutputSettings outputSettings = null; - // byte[] response = api.getResultStreamById(jobId, streamId, outputSettings); + ResultStreamRequest resultStreamRequest = null; + byte[] response = api.getResultStream(jobId, resultStreamRequest); // TODO: test validations } @@ -191,7 +182,7 @@ public void getResultStreamByIdTest() throws ApiException { public void getResultStreamsAsContainerTest() throws ApiException { String jobId = null; OutputSettings outputSettings = null; - // byte[] response = api.getResultStreamsAsContainer(jobId, outputSettings); + byte[] response = api.getResultStreamsAsContainer(jobId, outputSettings); // TODO: test validations } @@ -207,7 +198,7 @@ public void getResultStreamsAsContainerTest() throws ApiException { @Test public void getTemplateContextTest() throws ApiException { String templateId = null; - // TemplateContextResponse response = api.getTemplateContext(templateId); + TemplateContextResponse response = api.getTemplateContext(templateId); // TODO: test validations } @@ -223,7 +214,7 @@ public void getTemplateContextTest() throws ApiException { @Test public void submitJobTest() throws ApiException { MergeSettings mergesettings = null; - // MergeJobResponse response = api.submitJob(mergesettings); + MergeJobResponse response = api.submitJob(mergesettings); // TODO: test validations } @@ -238,8 +229,8 @@ public void submitJobTest() throws ApiException { */ @Test public void updateTemplateContextTest() throws ApiException { - TemplateContextRequest templateContextRequest = null; - // TemplateContextResponse response = api.updateTemplateContext(templateContextRequest); + TemplateContext templateContext = null; + TemplateContextResponse response = api.updateTemplateContext(templateContext); // TODO: test validations } @@ -256,7 +247,7 @@ public void updateTemplateContextTest() throws ApiException { public void uploadTemplateFileTest() throws ApiException { String templateId = null; File stream = null; - // TemplateContextResponse response = api.uploadTemplateFile(templateId, stream); + TemplateContextResponse response = api.uploadTemplateFile(templateId, stream); // TODO: test validations } diff --git a/java8/src/test/java/com/sphereon/sdk/template/processor/api/DataSetApiTest.java b/java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/DataSetApiTest.java similarity index 62% rename from java8/src/test/java/com/sphereon/sdk/template/processor/api/DataSetApiTest.java rename to java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/DataSetApiTest.java index bc50ec3..e963449 100644 --- a/java8/src/test/java/com/sphereon/sdk/template/processor/api/DataSetApiTest.java +++ b/java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/DataSetApiTest.java @@ -1,4 +1,4 @@ -/** +/* * Template-Processor * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store * @@ -8,27 +8,16 @@ * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ -package com.sphereon.sdk.template.processor.api; +package com.sphereon.sdk.template_processor.api; -import com.sphereon.sdk.template.processor.handler.ApiException; -import com.sphereon.sdk.template.processor.model.DataSetResponse; -import com.sphereon.sdk.template.processor.model.ErrorResponse; +import com.sphereon.sdk.template_processor.handler.ApiException; +import com.sphereon.sdk.template_processor.model.DataSetResponse; +import com.sphereon.sdk.template_processor.model.ErrorResponse; import org.junit.Test; +import org.junit.Ignore; import java.util.ArrayList; import java.util.HashMap; @@ -38,6 +27,7 @@ /** * API tests for DataSetApi */ +@Ignore public class DataSetApiTest { private final DataSetApi api = new DataSetApi(); @@ -54,7 +44,7 @@ public class DataSetApiTest { @Test public void createDataSetTest() throws ApiException { String payload = null; - // DataSetResponse response = api.createDataSet(payload); + DataSetResponse response = api.createDataSet(payload); // TODO: test validations } @@ -70,7 +60,7 @@ public void createDataSetTest() throws ApiException { @Test public void deleteDataSetTest() throws ApiException { String dataSetId = null; - // DataSetResponse response = api.deleteDataSet(dataSetId); + DataSetResponse response = api.deleteDataSet(dataSetId); // TODO: test validations } diff --git a/java8/src/test/java/com/sphereon/sdk/template/processor/api/JobApiTest.java b/java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/JobApiTest.java similarity index 64% rename from java8/src/test/java/com/sphereon/sdk/template/processor/api/JobApiTest.java rename to java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/JobApiTest.java index e8be532..a510528 100644 --- a/java8/src/test/java/com/sphereon/sdk/template/processor/api/JobApiTest.java +++ b/java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/JobApiTest.java @@ -1,4 +1,4 @@ -/** +/* * Template-Processor * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store * @@ -8,29 +8,19 @@ * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ -package com.sphereon.sdk.template.processor.api; +package com.sphereon.sdk.template_processor.api; -import com.sphereon.sdk.template.processor.handler.ApiException; -import com.sphereon.sdk.template.processor.model.MergeJobResponse; -import com.sphereon.sdk.template.processor.model.ErrorResponse; -import com.sphereon.sdk.template.processor.model.OutputSettings; -import com.sphereon.sdk.template.processor.model.MergeSettings; +import com.sphereon.sdk.template_processor.handler.ApiException; +import com.sphereon.sdk.template_processor.model.ErrorResponse; +import com.sphereon.sdk.template_processor.model.MergeJobResponse; +import com.sphereon.sdk.template_processor.model.MergeSettings; +import com.sphereon.sdk.template_processor.model.OutputSettings; +import com.sphereon.sdk.template_processor.model.ResultStreamRequest; import org.junit.Test; +import org.junit.Ignore; import java.util.ArrayList; import java.util.HashMap; @@ -40,6 +30,7 @@ /** * API tests for JobApi */ +@Ignore public class JobApiTest { private final JobApi api = new JobApi(); @@ -56,7 +47,7 @@ public class JobApiTest { @Test public void getJobTest() throws ApiException { String jobId = null; - // MergeJobResponse response = api.getJob(jobId); + MergeJobResponse response = api.getJob(jobId); // TODO: test validations } @@ -72,7 +63,7 @@ public void getJobTest() throws ApiException { @Test public void getJobsTest() throws ApiException { List status = null; - // List response = api.getJobs(status); + List response = api.getJobs(status); // TODO: test validations } @@ -86,11 +77,10 @@ public void getJobsTest() throws ApiException { * if the Api call fails */ @Test - public void getResultStreamByIdTest() throws ApiException { + public void getResultStreamTest() throws ApiException { String jobId = null; - String streamId = null; - OutputSettings outputSettings = null; - // byte[] response = api.getResultStreamById(jobId, streamId, outputSettings); + ResultStreamRequest resultStreamRequest = null; + byte[] response = api.getResultStream(jobId, resultStreamRequest); // TODO: test validations } @@ -107,7 +97,7 @@ public void getResultStreamByIdTest() throws ApiException { public void getResultStreamsAsContainerTest() throws ApiException { String jobId = null; OutputSettings outputSettings = null; - // byte[] response = api.getResultStreamsAsContainer(jobId, outputSettings); + byte[] response = api.getResultStreamsAsContainer(jobId, outputSettings); // TODO: test validations } @@ -123,7 +113,7 @@ public void getResultStreamsAsContainerTest() throws ApiException { @Test public void submitJobTest() throws ApiException { MergeSettings mergesettings = null; - // MergeJobResponse response = api.submitJob(mergesettings); + MergeJobResponse response = api.submitJob(mergesettings); // TODO: test validations } diff --git a/java8/src/test/java/com/sphereon/sdk/template/processor/api/TemplateApiTest.java b/java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/TemplateApiTest.java similarity index 65% rename from java8/src/test/java/com/sphereon/sdk/template/processor/api/TemplateApiTest.java rename to java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/TemplateApiTest.java index 284602c..0ff52fd 100644 --- a/java8/src/test/java/com/sphereon/sdk/template/processor/api/TemplateApiTest.java +++ b/java8-jersey2/src/test/java/com/sphereon/sdk/template_processor/api/TemplateApiTest.java @@ -1,4 +1,4 @@ -/** +/* * Template-Processor * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store * @@ -8,29 +8,19 @@ * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ -package com.sphereon.sdk.template.processor.api; +package com.sphereon.sdk.template_processor.api; -import com.sphereon.sdk.template.processor.handler.ApiException; -import com.sphereon.sdk.template.processor.model.TemplateContextResponse; -import com.sphereon.sdk.template.processor.model.TemplateContextRequest; -import com.sphereon.sdk.template.processor.model.ErrorResponse; +import com.sphereon.sdk.template_processor.handler.ApiException; +import com.sphereon.sdk.template_processor.model.ErrorResponse; import java.io.File; +import com.sphereon.sdk.template_processor.model.TemplateContext; +import com.sphereon.sdk.template_processor.model.TemplateContextRequest; +import com.sphereon.sdk.template_processor.model.TemplateContextResponse; import org.junit.Test; +import org.junit.Ignore; import java.util.ArrayList; import java.util.HashMap; @@ -40,6 +30,7 @@ /** * API tests for TemplateApi */ +@Ignore public class TemplateApiTest { private final TemplateApi api = new TemplateApi(); @@ -56,7 +47,7 @@ public class TemplateApiTest { @Test public void createTemplateContextTest() throws ApiException { TemplateContextRequest templateRequest = null; - // TemplateContextResponse response = api.createTemplateContext(templateRequest); + TemplateContextResponse response = api.createTemplateContext(templateRequest); // TODO: test validations } @@ -72,7 +63,7 @@ public void createTemplateContextTest() throws ApiException { @Test public void deleteTemplateContextTest() throws ApiException { String templateId = null; - // TemplateContextResponse response = api.deleteTemplateContext(templateId); + TemplateContextResponse response = api.deleteTemplateContext(templateId); // TODO: test validations } @@ -88,7 +79,7 @@ public void deleteTemplateContextTest() throws ApiException { @Test public void getTemplateContextTest() throws ApiException { String templateId = null; - // TemplateContextResponse response = api.getTemplateContext(templateId); + TemplateContextResponse response = api.getTemplateContext(templateId); // TODO: test validations } @@ -103,8 +94,8 @@ public void getTemplateContextTest() throws ApiException { */ @Test public void updateTemplateContextTest() throws ApiException { - TemplateContextRequest templateContextRequest = null; - // TemplateContextResponse response = api.updateTemplateContext(templateContextRequest); + TemplateContext templateContext = null; + TemplateContextResponse response = api.updateTemplateContext(templateContext); // TODO: test validations } @@ -121,7 +112,7 @@ public void updateTemplateContextTest() throws ApiException { public void uploadTemplateFileTest() throws ApiException { String templateId = null; File stream = null; - // TemplateContextResponse response = api.uploadTemplateFile(templateId, stream); + TemplateContextResponse response = api.uploadTemplateFile(templateId, stream); // TODO: test validations } diff --git a/java8-okhttp-gson/.gitignore b/java8-okhttp-gson/.gitignore new file mode 100644 index 0000000..a530464 --- /dev/null +++ b/java8-okhttp-gson/.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/java8-okhttp-gson/.swagger-codegen-ignore b/java8-okhttp-gson/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/java8-okhttp-gson/.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/java8-okhttp-gson/.swagger-codegen/VERSION b/java8-okhttp-gson/.swagger-codegen/VERSION new file mode 100644 index 0000000..a625450 --- /dev/null +++ b/java8-okhttp-gson/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/java8-okhttp-gson/.travis.yml b/java8-okhttp-gson/.travis.yml new file mode 100644 index 0000000..70cb81a --- /dev/null +++ b/java8-okhttp-gson/.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/java8/README.md b/java8-okhttp-gson/README.md similarity index 87% rename from java8/README.md rename to java8-okhttp-gson/README.md index 6e6208f..e9435a0 100644 --- a/java8/README.md +++ b/java8-okhttp-gson/README.md @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.sphereon.sdk template-processor-sdk-java8 - 0.1.2-SNAPSHOT + 0.1.1 compile ``` @@ -38,7 +38,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "com.sphereon.sdk:template-processor-sdk-java8:0.1.2-SNAPSHOT" +compile "com.sphereon.sdk:template-processor-sdk-java8:0.1.1" ``` ### Others @@ -49,7 +49,7 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/template-processor-sdk-java8-0.1.2-SNAPSHOT.jar +* target/template-processor-sdk-java8-0.1.1.jar * target/lib/*.jar ## Getting Started @@ -58,10 +58,10 @@ Please follow the [installation](#installation) instruction and execute the foll ```java -import com.sphereon.sdk.template.processor.handler.*; -import com.sphereon.sdk.template.processor.handler.auth.*; -import com.sphereon.sdk.template.processor.handler.model.*; -import com.sphereon.sdk.template.processor.api.AllApi; +import com.sphereon.sdk.template_processor.handler.*; +import com.sphereon.sdk.template_processor.handler.auth.*; +import com.sphereon.sdk.template_processor.model.*; +import com.sphereon.sdk.template_processor.api.AllApi; import java.io.File; import java.util.*; @@ -91,7 +91,7 @@ public class AllApiExample { ## Documentation for API Endpoints -All URIs are relative to *https://gw.api.cloud.sphereon.com/* +All URIs are relative to *https://gw.api.cloud.sphereon.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -102,7 +102,7 @@ Class | Method | HTTP request | Description *AllApi* | [**deleteTemplateContext**](docs/AllApi.md#deleteTemplateContext) | **DELETE** /template/processor/0.1/templates/{templateId} | Delete template context *AllApi* | [**getJob**](docs/AllApi.md#getJob) | **GET** /template/processor/0.1/jobs/{jobId} | Job definition and state *AllApi* | [**getJobs**](docs/AllApi.md#getJobs) | **GET** /template/processor/0.1/jobs | Get all jobs -*AllApi* | [**getResultStreamById**](docs/AllApi.md#getResultStreamById) | **PUT** /template/processor/0.1/jobs/{jobId}/result/file/{streamId} | Get the result file +*AllApi* | [**getResultStream**](docs/AllApi.md#getResultStream) | **PUT** /template/processor/0.1/jobs/{jobId}/result/stream | Get the result file *AllApi* | [**getResultStreamsAsContainer**](docs/AllApi.md#getResultStreamsAsContainer) | **PUT** /template/processor/0.1/jobs/{jobId}/result/container | Get the result file *AllApi* | [**getTemplateContext**](docs/AllApi.md#getTemplateContext) | **GET** /template/processor/0.1/templates/{templateId} | Get template context *AllApi* | [**submitJob**](docs/AllApi.md#submitJob) | **PUT** /template/processor/0.1/jobs | Submit merge job for processing @@ -112,7 +112,7 @@ Class | Method | HTTP request | Description *DataSetApi* | [**deleteDataSet**](docs/DataSetApi.md#deleteDataSet) | **DELETE** /template/processor/0.1/datasets/{dataSetId} | Delete a stored data set *JobApi* | [**getJob**](docs/JobApi.md#getJob) | **GET** /template/processor/0.1/jobs/{jobId} | Job definition and state *JobApi* | [**getJobs**](docs/JobApi.md#getJobs) | **GET** /template/processor/0.1/jobs | Get all jobs -*JobApi* | [**getResultStreamById**](docs/JobApi.md#getResultStreamById) | **PUT** /template/processor/0.1/jobs/{jobId}/result/file/{streamId} | Get the result file +*JobApi* | [**getResultStream**](docs/JobApi.md#getResultStream) | **PUT** /template/processor/0.1/jobs/{jobId}/result/stream | Get the result file *JobApi* | [**getResultStreamsAsContainer**](docs/JobApi.md#getResultStreamsAsContainer) | **PUT** /template/processor/0.1/jobs/{jobId}/result/container | Get the result file *JobApi* | [**submitJob**](docs/JobApi.md#submitJob) | **PUT** /template/processor/0.1/jobs | Submit merge job for processing *TemplateApi* | [**createTemplateContext**](docs/TemplateApi.md#createTemplateContext) | **POST** /template/processor/0.1/templates | Create template context @@ -133,6 +133,8 @@ Class | Method | HTTP request | Description - [MergeSettings](docs/MergeSettings.md) - [OutputSettings](docs/OutputSettings.md) - [OwnerInfo](docs/OwnerInfo.md) + - [ResultStreamRequest](docs/ResultStreamRequest.md) + - [StorageLocation](docs/StorageLocation.md) - [StreamLocation](docs/StreamLocation.md) - [TemplateContext](docs/TemplateContext.md) - [TemplateContextRequest](docs/TemplateContextRequest.md) @@ -146,14 +148,14 @@ Authentication schemes defined for the API: - **Type**: OAuth - **Flow**: application -- **Authorizatoin URL**: +- **Authorization URL**: - **Scopes**: - global: accessEverything ## Recommendation -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issue. +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. ## Author diff --git a/java8/build.gradle b/java8-okhttp-gson/build.gradle similarity index 83% rename from java8/build.gradle rename to java8-okhttp-gson/build.gradle index 314d1b1..f33bab3 100644 --- a/java8/build.gradle +++ b/java8-okhttp-gson/build.gradle @@ -2,15 +2,15 @@ apply plugin: 'idea' apply plugin: 'eclipse' group = 'com.sphereon.sdk' -version = '1.0.0-SNAPSHOT' +version = '0.1.1' buildscript { repositories { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.5.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' } } @@ -25,15 +25,15 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'com.github.dcendents.android-maven' android { - compileSdkVersion 23 - buildToolsVersion '23.0.2' + compileSdkVersion 25 + buildToolsVersion '25.0.2' defaultConfig { minSdkVersion 14 - targetSdkVersion 23 + targetSdkVersion 25 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } // Rename the aar correctly @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') { install { repositories.mavenInstaller { - pom.artifactId = 'office-text-sdk-java8' + pom.artifactId = 'template-processor-sdk-java8' } } @@ -94,9 +94,9 @@ if(hasProperty('target') && target == 'android') { } dependencies { - compile 'io.swagger:swagger-annotations:1.5.8' + compile 'io.swagger:swagger-annotations:1.5.15' compile 'com.squareup.okhttp:okhttp:2.7.5' compile 'com.squareup.okhttp:logging-interceptor:2.7.5' - compile 'com.google.code.gson:gson:2.6.2' + compile 'com.google.code.gson:gson:2.8.1' testCompile 'junit:junit:4.12' } diff --git a/java8/build.sbt b/java8-okhttp-gson/build.sbt similarity index 76% rename from java8/build.sbt rename to java8-okhttp-gson/build.sbt index bb9e1b9..e398cf5 100644 --- a/java8/build.sbt +++ b/java8-okhttp-gson/build.sbt @@ -1,18 +1,18 @@ lazy val root = (project in file(".")). settings( organization := "com.sphereon.sdk", - name := "office-text-sdk-java8", - version := "1.0.0-SNAPSHOT", + name := "template-processor-sdk-java8", + version := "0.1.1", 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" % "swagger-annotations" % "1.5.8", + "io.swagger" % "swagger-annotations" % "1.5.15", "com.squareup.okhttp" % "okhttp" % "2.7.5", "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", - "com.google.code.gson" % "gson" % "2.6.2", + "com.google.code.gson" % "gson" % "2.8.1", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/java8-okhttp-gson/git_push.sh b/java8-okhttp-gson/git_push.sh new file mode 100644 index 0000000..ae01b18 --- /dev/null +++ b/java8-okhttp-gson/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/java8-okhttp-gson/gradle.properties b/java8-okhttp-gson/gradle.properties new file mode 100644 index 0000000..05644f0 --- /dev/null +++ b/java8-okhttp-gson/gradle.properties @@ -0,0 +1,2 @@ +# Uncomment to build for Android +#target = android \ No newline at end of file diff --git a/java8-okhttp-gson/gradle/wrapper/gradle-wrapper.jar b/java8-okhttp-gson/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..2c6137b Binary files /dev/null and b/java8-okhttp-gson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/java8-okhttp-gson/gradle/wrapper/gradle-wrapper.properties b/java8-okhttp-gson/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..b7a3647 --- /dev/null +++ b/java8-okhttp-gson/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/java8-okhttp-gson/gradlew b/java8-okhttp-gson/gradlew new file mode 100644 index 0000000..9d82f78 --- /dev/null +++ b/java8-okhttp-gson/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/java8-okhttp-gson/gradlew.bat b/java8-okhttp-gson/gradlew.bat new file mode 100644 index 0000000..5f19212 --- /dev/null +++ b/java8-okhttp-gson/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/java8-okhttp-gson/settings.gradle b/java8-okhttp-gson/settings.gradle new file mode 100644 index 0000000..41ece0e --- /dev/null +++ b/java8-okhttp-gson/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "template-processor-sdk-java8" \ No newline at end of file diff --git a/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/AllApiTest.java b/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/AllApiTest.java new file mode 100644 index 0000000..95138fd --- /dev/null +++ b/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/AllApiTest.java @@ -0,0 +1,255 @@ +/* + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * 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 com.sphereon.sdk.template_processor.api; + +import com.sphereon.sdk.template_processor.handler.ApiException; +import com.sphereon.sdk.template_processor.model.DataSetResponse; +import com.sphereon.sdk.template_processor.model.ErrorResponse; +import java.io.File; +import com.sphereon.sdk.template_processor.model.MergeJobResponse; +import com.sphereon.sdk.template_processor.model.MergeSettings; +import com.sphereon.sdk.template_processor.model.OutputSettings; +import com.sphereon.sdk.template_processor.model.ResultStreamRequest; +import com.sphereon.sdk.template_processor.model.TemplateContext; +import com.sphereon.sdk.template_processor.model.TemplateContextRequest; +import com.sphereon.sdk.template_processor.model.TemplateContextResponse; +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 AllApi + */ +@Ignore +public class AllApiTest { + + private final AllApi api = new AllApi(); + + + /** + * Store dataset + * + * Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createDataSetTest() throws ApiException { + String payload = null; + DataSetResponse response = api.createDataSet(payload); + + // TODO: test validations + } + + /** + * Create template context + * + * Create a unique template context for your environment + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createTemplateContextTest() throws ApiException { + TemplateContextRequest templateRequest = null; + TemplateContextResponse response = api.createTemplateContext(templateRequest); + + // TODO: test validations + } + + /** + * Delete a stored data set + * + * Delete a stored data set + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteDataSetTest() throws ApiException { + String dataSetId = null; + DataSetResponse response = api.deleteDataSet(dataSetId); + + // TODO: test validations + } + + /** + * Delete a job manually + * + * Delete the merge job and all related files + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteJobTest() throws ApiException { + String jobId = null; + MergeJobResponse response = api.deleteJob(jobId); + + // TODO: test validations + } + + /** + * Delete template context + * + * Delete a template context with all history + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteTemplateContextTest() throws ApiException { + String templateId = null; + TemplateContextResponse response = api.deleteTemplateContext(templateId); + + // TODO: test validations + } + + /** + * Job definition and state + * + * Get the merge job definition and current state. Please not that you can differentiate based on http response status + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getJobTest() throws ApiException { + String jobId = null; + MergeJobResponse response = api.getJob(jobId); + + // TODO: test validations + } + + /** + * Get all jobs + * + * Get all office text job definitions and their current state. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getJobsTest() throws ApiException { + List status = null; + List response = api.getJobs(status); + + // TODO: test validations + } + + /** + * Get the result file + * + * Get a merge result document as a binary stream. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getResultStreamTest() throws ApiException { + String jobId = null; + ResultStreamRequest resultStreamRequest = null; + byte[] response = api.getResultStream(jobId, resultStreamRequest); + + // TODO: test validations + } + + /** + * Get the result file + * + * Get all documents inside a compressed container as a binary stream. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getResultStreamsAsContainerTest() throws ApiException { + String jobId = null; + OutputSettings outputSettings = null; + byte[] response = api.getResultStreamsAsContainer(jobId, outputSettings); + + // TODO: test validations + } + + /** + * Get template context + * + * Get an existing template context + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getTemplateContextTest() throws ApiException { + String templateId = null; + TemplateContextResponse response = api.getTemplateContext(templateId); + + // TODO: test validations + } + + /** + * Submit merge job for processing + * + * Submit merge job run. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void submitJobTest() throws ApiException { + MergeSettings mergesettings = null; + MergeJobResponse response = api.submitJob(mergesettings); + + // TODO: test validations + } + + /** + * Update template context + * + * Update an existing template context for your environment + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateTemplateContextTest() throws ApiException { + TemplateContext templateContext = null; + TemplateContextResponse response = api.updateTemplateContext(templateContext); + + // TODO: test validations + } + + /** + * Upload template file + * + * Upload the Office template file + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadTemplateFileTest() throws ApiException { + String templateId = null; + File stream = null; + TemplateContextResponse response = api.uploadTemplateFile(templateId, stream); + + // TODO: test validations + } + +} diff --git a/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/DataSetApiTest.java b/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/DataSetApiTest.java new file mode 100644 index 0000000..e963449 --- /dev/null +++ b/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/DataSetApiTest.java @@ -0,0 +1,68 @@ +/* + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * 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 com.sphereon.sdk.template_processor.api; + +import com.sphereon.sdk.template_processor.handler.ApiException; +import com.sphereon.sdk.template_processor.model.DataSetResponse; +import com.sphereon.sdk.template_processor.model.ErrorResponse; +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 DataSetApi + */ +@Ignore +public class DataSetApiTest { + + private final DataSetApi api = new DataSetApi(); + + + /** + * Store dataset + * + * Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createDataSetTest() throws ApiException { + String payload = null; + DataSetResponse response = api.createDataSet(payload); + + // TODO: test validations + } + + /** + * Delete a stored data set + * + * Delete a stored data set + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteDataSetTest() throws ApiException { + String dataSetId = null; + DataSetResponse response = api.deleteDataSet(dataSetId); + + // TODO: test validations + } + +} diff --git a/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/JobApiTest.java b/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/JobApiTest.java new file mode 100644 index 0000000..a510528 --- /dev/null +++ b/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/JobApiTest.java @@ -0,0 +1,121 @@ +/* + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * 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 com.sphereon.sdk.template_processor.api; + +import com.sphereon.sdk.template_processor.handler.ApiException; +import com.sphereon.sdk.template_processor.model.ErrorResponse; +import com.sphereon.sdk.template_processor.model.MergeJobResponse; +import com.sphereon.sdk.template_processor.model.MergeSettings; +import com.sphereon.sdk.template_processor.model.OutputSettings; +import com.sphereon.sdk.template_processor.model.ResultStreamRequest; +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 JobApi + */ +@Ignore +public class JobApiTest { + + private final JobApi api = new JobApi(); + + + /** + * Job definition and state + * + * Get the merge job definition and current state. Please not that you can differentiate based on http response status + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getJobTest() throws ApiException { + String jobId = null; + MergeJobResponse response = api.getJob(jobId); + + // TODO: test validations + } + + /** + * Get all jobs + * + * Get all office text job definitions and their current state. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getJobsTest() throws ApiException { + List status = null; + List response = api.getJobs(status); + + // TODO: test validations + } + + /** + * Get the result file + * + * Get a merge result document as a binary stream. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getResultStreamTest() throws ApiException { + String jobId = null; + ResultStreamRequest resultStreamRequest = null; + byte[] response = api.getResultStream(jobId, resultStreamRequest); + + // TODO: test validations + } + + /** + * Get the result file + * + * Get all documents inside a compressed container as a binary stream. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getResultStreamsAsContainerTest() throws ApiException { + String jobId = null; + OutputSettings outputSettings = null; + byte[] response = api.getResultStreamsAsContainer(jobId, outputSettings); + + // TODO: test validations + } + + /** + * Submit merge job for processing + * + * Submit merge job run. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void submitJobTest() throws ApiException { + MergeSettings mergesettings = null; + MergeJobResponse response = api.submitJob(mergesettings); + + // TODO: test validations + } + +} diff --git a/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/TemplateApiTest.java b/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/TemplateApiTest.java new file mode 100644 index 0000000..0ff52fd --- /dev/null +++ b/java8-okhttp-gson/src/test/java/com/sphereon/sdk/template_processor/api/TemplateApiTest.java @@ -0,0 +1,120 @@ +/* + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * 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 com.sphereon.sdk.template_processor.api; + +import com.sphereon.sdk.template_processor.handler.ApiException; +import com.sphereon.sdk.template_processor.model.ErrorResponse; +import java.io.File; +import com.sphereon.sdk.template_processor.model.TemplateContext; +import com.sphereon.sdk.template_processor.model.TemplateContextRequest; +import com.sphereon.sdk.template_processor.model.TemplateContextResponse; +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 TemplateApi + */ +@Ignore +public class TemplateApiTest { + + private final TemplateApi api = new TemplateApi(); + + + /** + * Create template context + * + * Create a unique template context for your environment + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createTemplateContextTest() throws ApiException { + TemplateContextRequest templateRequest = null; + TemplateContextResponse response = api.createTemplateContext(templateRequest); + + // TODO: test validations + } + + /** + * Delete template context + * + * Delete a template context with all history + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteTemplateContextTest() throws ApiException { + String templateId = null; + TemplateContextResponse response = api.deleteTemplateContext(templateId); + + // TODO: test validations + } + + /** + * Get template context + * + * Get an existing template context + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getTemplateContextTest() throws ApiException { + String templateId = null; + TemplateContextResponse response = api.getTemplateContext(templateId); + + // TODO: test validations + } + + /** + * Update template context + * + * Update an existing template context for your environment + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateTemplateContextTest() throws ApiException { + TemplateContext templateContext = null; + TemplateContextResponse response = api.updateTemplateContext(templateContext); + + // TODO: test validations + } + + /** + * Upload template file + * + * Upload the Office template file + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadTemplateFileTest() throws ApiException { + String templateId = null; + File stream = null; + TemplateContextResponse response = api.uploadTemplateFile(templateId, stream); + + // TODO: test validations + } + +} diff --git a/java8-retrofit2/.gitignore b/java8-retrofit2/.gitignore new file mode 100644 index 0000000..a530464 --- /dev/null +++ b/java8-retrofit2/.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/java8-retrofit2/.swagger-codegen-ignore b/java8-retrofit2/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/java8-retrofit2/.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/java8-retrofit2/.swagger-codegen/VERSION b/java8-retrofit2/.swagger-codegen/VERSION new file mode 100644 index 0000000..a625450 --- /dev/null +++ b/java8-retrofit2/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/java8-retrofit2/.travis.yml b/java8-retrofit2/.travis.yml new file mode 100644 index 0000000..70cb81a --- /dev/null +++ b/java8-retrofit2/.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/java8-retrofit2/README.md b/java8-retrofit2/README.md new file mode 100644 index 0000000..369f17d --- /dev/null +++ b/java8-retrofit2/README.md @@ -0,0 +1,39 @@ +# template-processor-sdk-java8-retrofit2 + +## Requirements + +Building the API client library requires [Maven](https://maven.apache.org/) to be installed. + +## Installation & Usage + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn deploy +``` + +Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. + +After the client library is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*: + +```xml + + com.sphereon.sdk + template-processor-sdk-java8-retrofit2 + 0.1.1 + compile + + +``` + +## Author + +dev@sphereon.com + + diff --git a/java8-retrofit2/build.gradle b/java8-retrofit2/build.gradle new file mode 100644 index 0000000..f168d05 --- /dev/null +++ b/java8-retrofit2/build.gradle @@ -0,0 +1,111 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'com.sphereon.sdk' +version = '0.1.1' + +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_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // 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_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + install { + repositories.mavenInstaller { + pom.artifactId = 'template-processor-sdk-java8-retrofit2' + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + oltu_version = "1.0.1" + retrofit_version = "2.3.0" + swagger_annotations_version = "1.5.15" + junit_version = "4.12" +} + +dependencies { + compile "com.squareup.retrofit2:retrofit:$retrofit_version" + compile "com.squareup.retrofit2:converter-scalars:$retrofit_version" + compile "com.squareup.retrofit2:converter-gson:$retrofit_version" + compile "io.swagger:swagger-annotations:$swagger_annotations_version" + compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" + + testCompile "junit:junit:$junit_version" +} diff --git a/java8-retrofit2/build.sbt b/java8-retrofit2/build.sbt new file mode 100644 index 0000000..3189802 --- /dev/null +++ b/java8-retrofit2/build.sbt @@ -0,0 +1,20 @@ +lazy val root = (project in file(".")). + settings( + organization := "com.sphereon.sdk", + name := "template-processor-sdk-java8-retrofit2", + version := "0.1.1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.15" % "compile", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "junit" % "junit" % "4.12" % "test", + "com.novocode" % "junit-interface" % "0.11" % "test" + ) + ) diff --git a/java8-retrofit2/git_push.sh b/java8-retrofit2/git_push.sh new file mode 100644 index 0000000..ae01b18 --- /dev/null +++ b/java8-retrofit2/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/java8-retrofit2/gradle.properties b/java8-retrofit2/gradle.properties new file mode 100644 index 0000000..05644f0 --- /dev/null +++ b/java8-retrofit2/gradle.properties @@ -0,0 +1,2 @@ +# Uncomment to build for Android +#target = android \ No newline at end of file diff --git a/java8-retrofit2/gradle/wrapper/gradle-wrapper.jar b/java8-retrofit2/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..2c6137b Binary files /dev/null and b/java8-retrofit2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/java8-retrofit2/gradle/wrapper/gradle-wrapper.properties b/java8-retrofit2/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..b7a3647 --- /dev/null +++ b/java8-retrofit2/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/java8-retrofit2/gradlew b/java8-retrofit2/gradlew new file mode 100644 index 0000000..9d82f78 --- /dev/null +++ b/java8-retrofit2/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/java8-retrofit2/gradlew.bat b/java8-retrofit2/gradlew.bat new file mode 100644 index 0000000..5f19212 --- /dev/null +++ b/java8-retrofit2/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/java8-retrofit2/pom.xml b/java8-retrofit2/pom.xml new file mode 100644 index 0000000..eb46baf --- /dev/null +++ b/java8-retrofit2/pom.xml @@ -0,0 +1,243 @@ + + 4.0.0 + com.sphereon.sdk + template-processor-sdk-java8-retrofit2 + jar + template-processor-sdk-java8-retrofit2 + 0.1.2 + 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 + + + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 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 + swagger-annotations + ${swagger-core-version} + + + com.squareup.retrofit2 + converter-gson + ${retrofit-version} + + + com.squareup.retrofit2 + retrofit + ${retrofit-version} + + + com.squareup.retrofit2 + converter-scalars + ${retrofit-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + + + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.8 + ${java.version} + ${java.version} + 1.8.0 + 1.5.15 + 2.3.0 + 1.0.1 + 4.12 + + diff --git a/java8-retrofit2/settings.gradle b/java8-retrofit2/settings.gradle new file mode 100644 index 0000000..7e0d801 --- /dev/null +++ b/java8-retrofit2/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "template-processor-sdk-java8-retrofit2" \ No newline at end of file diff --git a/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/AllApiTest.java b/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/AllApiTest.java new file mode 100644 index 0000000..bc6b517 --- /dev/null +++ b/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/AllApiTest.java @@ -0,0 +1,207 @@ +package com.sphereon.sdk.template_processor.api; + +import com.sphereon.sdk.template_processor.handler.ApiClient; +import com.sphereon.sdk.template_processor.model.DataSetResponse; +import com.sphereon.sdk.template_processor.model.ErrorResponse; +import java.io.File; +import com.sphereon.sdk.template_processor.model.MergeJobResponse; +import com.sphereon.sdk.template_processor.model.MergeSettings; +import com.sphereon.sdk.template_processor.model.OutputSettings; +import com.sphereon.sdk.template_processor.model.ResultStreamRequest; +import com.sphereon.sdk.template_processor.model.TemplateContext; +import com.sphereon.sdk.template_processor.model.TemplateContextRequest; +import com.sphereon.sdk.template_processor.model.TemplateContextResponse; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AllApi + */ +public class AllApiTest { + + private AllApi api; + + @Before + public void setup() { + api = new ApiClient().createService(AllApi.class); + } + + + /** + * Store dataset + * + * Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. + */ + @Test + public void createDataSetTest() { + String payload = null; + // DataSetResponse response = api.createDataSet(payload); + + // TODO: test validations + } + + /** + * Create template context + * + * Create a unique template context for your environment + */ + @Test + public void createTemplateContextTest() { + TemplateContextRequest templateRequest = null; + // TemplateContextResponse response = api.createTemplateContext(templateRequest); + + // TODO: test validations + } + + /** + * Delete a stored data set + * + * Delete a stored data set + */ + @Test + public void deleteDataSetTest() { + String dataSetId = null; + // DataSetResponse response = api.deleteDataSet(dataSetId); + + // TODO: test validations + } + + /** + * Delete a job manually + * + * Delete the merge job and all related files + */ + @Test + public void deleteJobTest() { + String jobId = null; + // MergeJobResponse response = api.deleteJob(jobId); + + // TODO: test validations + } + + /** + * Delete template context + * + * Delete a template context with all history + */ + @Test + public void deleteTemplateContextTest() { + String templateId = null; + // TemplateContextResponse response = api.deleteTemplateContext(templateId); + + // TODO: test validations + } + + /** + * Job definition and state + * + * Get the merge job definition and current state. Please not that you can differentiate based on http response status + */ + @Test + public void getJobTest() { + String jobId = null; + // MergeJobResponse response = api.getJob(jobId); + + // TODO: test validations + } + + /** + * Get all jobs + * + * Get all office text job definitions and their current state. + */ + @Test + public void getJobsTest() { + List status = null; + // List response = api.getJobs(status); + + // TODO: test validations + } + + /** + * Get the result file + * + * Get a merge result document as a binary stream. + */ + @Test + public void getResultStreamTest() { + String jobId = null; + ResultStreamRequest resultStreamRequest = null; + // byte[] response = api.getResultStream(jobId, resultStreamRequest); + + // TODO: test validations + } + + /** + * Get the result file + * + * Get all documents inside a compressed container as a binary stream. + */ + @Test + public void getResultStreamsAsContainerTest() { + String jobId = null; + OutputSettings outputSettings = null; + // byte[] response = api.getResultStreamsAsContainer(jobId, outputSettings); + + // TODO: test validations + } + + /** + * Get template context + * + * Get an existing template context + */ + @Test + public void getTemplateContextTest() { + String templateId = null; + // TemplateContextResponse response = api.getTemplateContext(templateId); + + // TODO: test validations + } + + /** + * Submit merge job for processing + * + * Submit merge job run. + */ + @Test + public void submitJobTest() { + MergeSettings mergesettings = null; + // MergeJobResponse response = api.submitJob(mergesettings); + + // TODO: test validations + } + + /** + * Update template context + * + * Update an existing template context for your environment + */ + @Test + public void updateTemplateContextTest() { + TemplateContext templateContext = null; + // TemplateContextResponse response = api.updateTemplateContext(templateContext); + + // TODO: test validations + } + + /** + * Upload template file + * + * Upload the Office template file + */ + @Test + public void uploadTemplateFileTest() { + String templateId = null; + File stream = null; + // TemplateContextResponse response = api.uploadTemplateFile(templateId, stream); + + // TODO: test validations + } + +} diff --git a/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/DataSetApiTest.java b/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/DataSetApiTest.java new file mode 100644 index 0000000..9577b9f --- /dev/null +++ b/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/DataSetApiTest.java @@ -0,0 +1,53 @@ +package com.sphereon.sdk.template_processor.api; + +import com.sphereon.sdk.template_processor.handler.ApiClient; +import com.sphereon.sdk.template_processor.model.DataSetResponse; +import com.sphereon.sdk.template_processor.model.ErrorResponse; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DataSetApi + */ +public class DataSetApiTest { + + private DataSetApi api; + + @Before + public void setup() { + api = new ApiClient().createService(DataSetApi.class); + } + + + /** + * Store dataset + * + * Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. + */ + @Test + public void createDataSetTest() { + String payload = null; + // DataSetResponse response = api.createDataSet(payload); + + // TODO: test validations + } + + /** + * Delete a stored data set + * + * Delete a stored data set + */ + @Test + public void deleteDataSetTest() { + String dataSetId = null; + // DataSetResponse response = api.deleteDataSet(dataSetId); + + // TODO: test validations + } + +} diff --git a/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/JobApiTest.java b/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/JobApiTest.java new file mode 100644 index 0000000..84a36ae --- /dev/null +++ b/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/JobApiTest.java @@ -0,0 +1,97 @@ +package com.sphereon.sdk.template_processor.api; + +import com.sphereon.sdk.template_processor.handler.ApiClient; +import com.sphereon.sdk.template_processor.model.ErrorResponse; +import com.sphereon.sdk.template_processor.model.MergeJobResponse; +import com.sphereon.sdk.template_processor.model.MergeSettings; +import com.sphereon.sdk.template_processor.model.OutputSettings; +import com.sphereon.sdk.template_processor.model.ResultStreamRequest; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for JobApi + */ +public class JobApiTest { + + private JobApi api; + + @Before + public void setup() { + api = new ApiClient().createService(JobApi.class); + } + + + /** + * Job definition and state + * + * Get the merge job definition and current state. Please not that you can differentiate based on http response status + */ + @Test + public void getJobTest() { + String jobId = null; + // MergeJobResponse response = api.getJob(jobId); + + // TODO: test validations + } + + /** + * Get all jobs + * + * Get all office text job definitions and their current state. + */ + @Test + public void getJobsTest() { + List status = null; + // List response = api.getJobs(status); + + // TODO: test validations + } + + /** + * Get the result file + * + * Get a merge result document as a binary stream. + */ + @Test + public void getResultStreamTest() { + String jobId = null; + ResultStreamRequest resultStreamRequest = null; + // byte[] response = api.getResultStream(jobId, resultStreamRequest); + + // TODO: test validations + } + + /** + * Get the result file + * + * Get all documents inside a compressed container as a binary stream. + */ + @Test + public void getResultStreamsAsContainerTest() { + String jobId = null; + OutputSettings outputSettings = null; + // byte[] response = api.getResultStreamsAsContainer(jobId, outputSettings); + + // TODO: test validations + } + + /** + * Submit merge job for processing + * + * Submit merge job run. + */ + @Test + public void submitJobTest() { + MergeSettings mergesettings = null; + // MergeJobResponse response = api.submitJob(mergesettings); + + // TODO: test validations + } + +} diff --git a/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/TemplateApiTest.java b/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/TemplateApiTest.java new file mode 100644 index 0000000..870a879 --- /dev/null +++ b/java8-retrofit2/src/test/java/com/sphereon/sdk/template_processor/api/TemplateApiTest.java @@ -0,0 +1,96 @@ +package com.sphereon.sdk.template_processor.api; + +import com.sphereon.sdk.template_processor.handler.ApiClient; +import com.sphereon.sdk.template_processor.model.ErrorResponse; +import java.io.File; +import com.sphereon.sdk.template_processor.model.TemplateContext; +import com.sphereon.sdk.template_processor.model.TemplateContextRequest; +import com.sphereon.sdk.template_processor.model.TemplateContextResponse; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for TemplateApi + */ +public class TemplateApiTest { + + private TemplateApi api; + + @Before + public void setup() { + api = new ApiClient().createService(TemplateApi.class); + } + + + /** + * Create template context + * + * Create a unique template context for your environment + */ + @Test + public void createTemplateContextTest() { + TemplateContextRequest templateRequest = null; + // TemplateContextResponse response = api.createTemplateContext(templateRequest); + + // TODO: test validations + } + + /** + * Delete template context + * + * Delete a template context with all history + */ + @Test + public void deleteTemplateContextTest() { + String templateId = null; + // TemplateContextResponse response = api.deleteTemplateContext(templateId); + + // TODO: test validations + } + + /** + * Get template context + * + * Get an existing template context + */ + @Test + public void getTemplateContextTest() { + String templateId = null; + // TemplateContextResponse response = api.getTemplateContext(templateId); + + // TODO: test validations + } + + /** + * Update template context + * + * Update an existing template context for your environment + */ + @Test + public void updateTemplateContextTest() { + TemplateContext templateContext = null; + // TemplateContextResponse response = api.updateTemplateContext(templateContext); + + // TODO: test validations + } + + /** + * Upload template file + * + * Upload the Office template file + */ + @Test + public void uploadTemplateFileTest() { + String templateId = null; + File stream = null; + // TemplateContextResponse response = api.uploadTemplateFile(templateId, stream); + + // TODO: test validations + } + +} diff --git a/java8/.travis.yml b/java8/.travis.yml deleted file mode 100644 index 33e7947..0000000 --- a/java8/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -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/java8/LICENSE b/java8/LICENSE deleted file mode 100644 index 8dada3e..0000000 --- a/java8/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/java8/docs/AllApi.md b/java8/docs/AllApi.md deleted file mode 100644 index 1fe35ea..0000000 --- a/java8/docs/AllApi.md +++ /dev/null @@ -1,718 +0,0 @@ -# AllApi - -All URIs are relative to *https://gw.api.cloud.sphereon.com/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createDataSet**](AllApi.md#createDataSet) | **POST** /template/processor/0.1/datasets | Store dataset -[**createTemplateContext**](AllApi.md#createTemplateContext) | **POST** /template/processor/0.1/templates | Create template context -[**deleteDataSet**](AllApi.md#deleteDataSet) | **DELETE** /template/processor/0.1/datasets/{dataSetId} | Delete a stored data set -[**deleteJob**](AllApi.md#deleteJob) | **DELETE** /template/processor/0.1/jobs/{jobId} | Delete a job manually -[**deleteTemplateContext**](AllApi.md#deleteTemplateContext) | **DELETE** /template/processor/0.1/templates/{templateId} | Delete template context -[**getJob**](AllApi.md#getJob) | **GET** /template/processor/0.1/jobs/{jobId} | Job definition and state -[**getJobs**](AllApi.md#getJobs) | **GET** /template/processor/0.1/jobs | Get all jobs -[**getResultStreamById**](AllApi.md#getResultStreamById) | **PUT** /template/processor/0.1/jobs/{jobId}/result/file/{streamId} | Get the result file -[**getResultStreamsAsContainer**](AllApi.md#getResultStreamsAsContainer) | **PUT** /template/processor/0.1/jobs/{jobId}/result/container | Get the result file -[**getTemplateContext**](AllApi.md#getTemplateContext) | **GET** /template/processor/0.1/templates/{templateId} | Get template context -[**submitJob**](AllApi.md#submitJob) | **PUT** /template/processor/0.1/jobs | Submit merge job for processing -[**updateTemplateContext**](AllApi.md#updateTemplateContext) | **PUT** /template/processor/0.1/templates | Update template context -[**uploadTemplateFile**](AllApi.md#uploadTemplateFile) | **POST** /template/processor/0.1/templates/{templateId} | Upload template file - - - -# **createDataSet** -> DataSetResponse createDataSet(payload) - -Store dataset - -Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -String payload = "payload_example"; // String | The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] -try { - DataSetResponse result = apiInstance.createDataSet(payload); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#createDataSet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **payload** | **String**| The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] | - -### Return type - -[**DataSetResponse**](DataSetResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - - -# **createTemplateContext** -> TemplateContextResponse createTemplateContext(templateRequest) - -Create template context - -Create a unique template context for your environment - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -TemplateContextRequest templateRequest = new TemplateContextRequest(); // TemplateContextRequest | The template request -try { - TemplateContextResponse result = apiInstance.createTemplateContext(templateRequest); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#createTemplateContext"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateRequest** | [**TemplateContextRequest**](TemplateContextRequest.md)| The template request | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - - -# **deleteDataSet** -> DataSetResponse deleteDataSet(dataSetId) - -Delete a stored data set - -Delete a stored data set - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -String dataSetId = "dataSetId_example"; // String | dataSetId -try { - DataSetResponse result = apiInstance.deleteDataSet(dataSetId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#deleteDataSet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **dataSetId** | **String**| dataSetId | - -### Return type - -[**DataSetResponse**](DataSetResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - - -# **deleteJob** -> MergeJobResponse deleteJob(jobId) - -Delete a job manually - -Delete the merge job and all related files - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -String jobId = "jobId_example"; // String | jobId -try { - MergeJobResponse result = apiInstance.deleteJob(jobId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#deleteJob"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **String**| jobId | - -### Return type - -[**MergeJobResponse**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - - -# **deleteTemplateContext** -> TemplateContextResponse deleteTemplateContext(templateId) - -Delete template context - -Delete a template context with all history - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -String templateId = "templateId_example"; // String | templateId -try { - TemplateContextResponse result = apiInstance.deleteTemplateContext(templateId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#deleteTemplateContext"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **String**| templateId | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - - -# **getJob** -> MergeJobResponse getJob(jobId) - -Job definition and state - -Get the merge job definition and current state. Please not that you can differentiate based on http response status - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -String jobId = "jobId_example"; // String | jobId -try { - MergeJobResponse result = apiInstance.getJob(jobId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#getJob"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **String**| jobId | - -### Return type - -[**MergeJobResponse**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - - -# **getJobs** -> List<MergeJobResponse> getJobs(status) - -Get all jobs - -Get all office text job definitions and their current state. - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -List status = Arrays.asList("status_example"); // List | A list of status to filter on. -try { - List result = apiInstance.getJobs(status); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#getJobs"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| A list of status to filter on. | [optional] [enum: CREATED, UPDATED, PROCESSING, DONE, ERROR, DELETED] - -### Return type - -[**List<MergeJobResponse>**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - - -# **getResultStreamById** -> byte[] getResultStreamById(jobId, streamId, outputSettings) - -Get the result file - -Get a merge result document as a binary stream. - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -String jobId = "jobId_example"; // String | jobId -String streamId = "streamId_example"; // String | streamId -OutputSettings outputSettings = new OutputSettings(); // OutputSettings | outputSettings -try { - byte[] result = apiInstance.getResultStreamById(jobId, streamId, outputSettings); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#getResultStreamById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **String**| jobId | - **streamId** | **String**| streamId | - **outputSettings** | [**OutputSettings**](OutputSettings.md)| outputSettings | [optional] - -### Return type - -**byte[]** - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/octet-stream - - -# **getResultStreamsAsContainer** -> byte[] getResultStreamsAsContainer(jobId, outputSettings) - -Get the result file - -Get all documents inside a compressed container as a binary stream. - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -String jobId = "jobId_example"; // String | jobId -OutputSettings outputSettings = new OutputSettings(); // OutputSettings | outputSettings -try { - byte[] result = apiInstance.getResultStreamsAsContainer(jobId, outputSettings); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#getResultStreamsAsContainer"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **String**| jobId | - **outputSettings** | [**OutputSettings**](OutputSettings.md)| outputSettings | [optional] - -### Return type - -**byte[]** - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/octet-stream - - -# **getTemplateContext** -> TemplateContextResponse getTemplateContext(templateId) - -Get template context - -Get an existing template context - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -String templateId = "templateId_example"; // String | The template context name unique for your environment -try { - TemplateContextResponse result = apiInstance.getTemplateContext(templateId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#getTemplateContext"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **String**| The template context name unique for your environment | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - - -# **submitJob** -> MergeJobResponse submitJob(mergesettings) - -Submit merge job for processing - -Submit merge job run. - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -MergeSettings mergesettings = new MergeSettings(); // MergeSettings | The merge- and output settings -try { - MergeJobResponse result = apiInstance.submitJob(mergesettings); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#submitJob"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **mergesettings** | [**MergeSettings**](MergeSettings.md)| The merge- and output settings | - -### Return type - -[**MergeJobResponse**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - - -# **updateTemplateContext** -> TemplateContextResponse updateTemplateContext(templateContextRequest) - -Update template context - -Update an existing template context for your environment - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -TemplateContextRequest templateContextRequest = new TemplateContextRequest(); // TemplateContextRequest | templateContextRequest -try { - TemplateContextResponse result = apiInstance.updateTemplateContext(templateContextRequest); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#updateTemplateContext"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateContextRequest** | [**TemplateContextRequest**](TemplateContextRequest.md)| templateContextRequest | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - - -# **uploadTemplateFile** -> TemplateContextResponse uploadTemplateFile(templateId, stream) - -Upload template file - -Upload the Office template file - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.AllApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -AllApi apiInstance = new AllApi(); -String templateId = "templateId_example"; // String | The template context name unique for your environment -File stream = new File("/path/to/file.txt"); // File | The template (file/inputstream) to store -try { - TemplateContextResponse result = apiInstance.uploadTemplateFile(templateId, stream); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AllApi#uploadTemplateFile"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **String**| The template context name unique for your environment | - **stream** | **File**| The template (file/inputstream) to store | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json;charset=UTF-8 - diff --git a/java8/docs/DataSetApi.md b/java8/docs/DataSetApi.md deleted file mode 100644 index b7082d1..0000000 --- a/java8/docs/DataSetApi.md +++ /dev/null @@ -1,116 +0,0 @@ -# DataSetApi - -All URIs are relative to *https://gw.api.cloud.sphereon.com/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createDataSet**](DataSetApi.md#createDataSet) | **POST** /template/processor/0.1/datasets | Store dataset -[**deleteDataSet**](DataSetApi.md#deleteDataSet) | **DELETE** /template/processor/0.1/datasets/{dataSetId} | Delete a stored data set - - - -# **createDataSet** -> DataSetResponse createDataSet(payload) - -Store dataset - -Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.DataSetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -DataSetApi apiInstance = new DataSetApi(); -String payload = "payload_example"; // String | The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] -try { - DataSetResponse result = apiInstance.createDataSet(payload); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling DataSetApi#createDataSet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **payload** | **String**| The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] | - -### Return type - -[**DataSetResponse**](DataSetResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - - -# **deleteDataSet** -> DataSetResponse deleteDataSet(dataSetId) - -Delete a stored data set - -Delete a stored data set - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.DataSetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -DataSetApi apiInstance = new DataSetApi(); -String dataSetId = "dataSetId_example"; // String | dataSetId -try { - DataSetResponse result = apiInstance.deleteDataSet(dataSetId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling DataSetApi#deleteDataSet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **dataSetId** | **String**| dataSetId | - -### Return type - -[**DataSetResponse**](DataSetResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - diff --git a/java8/docs/DataSetResponse.md b/java8/docs/DataSetResponse.md deleted file mode 100644 index 3e7502d..0000000 --- a/java8/docs/DataSetResponse.md +++ /dev/null @@ -1,22 +0,0 @@ - -# DataSetResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**completionTime** | [**OffsetDateTime**](OffsetDateTime.md) | The completion date/time of this template in ISO 8601 format | [optional] -**creationTime** | [**OffsetDateTime**](OffsetDateTime.md) | The creation date/time of this template in ISO 8601 format | [optional] -**id** | **String** | Unique dataset id | -**status** | [**StatusEnum**](#StatusEnum) | The status of the template | - - - -## Enum: StatusEnum -Name | Value ----- | ----- -CREATED | "CREATED" -UPDATED | "UPDATED" -DELETED | "DELETED" - - - diff --git a/java8/docs/Error.md b/java8/docs/Error.md deleted file mode 100644 index 249e09f..0000000 --- a/java8/docs/Error.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Error - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **String** | | -**level** | [**LevelEnum**](#LevelEnum) | | -**cause** | [**Error**](Error.md) | | [optional] -**message** | **String** | | - - - -## Enum: LevelEnum -Name | Value ----- | ----- -INFO | "INFO" -WARNING | "WARNING" -FATAL | "FATAL" - - - diff --git a/java8/docs/ErrorResponse.md b/java8/docs/ErrorResponse.md deleted file mode 100644 index 7132a3b..0000000 --- a/java8/docs/ErrorResponse.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ErrorResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**errors** | [**List<Error>**](Error.md) | | [optional] - - - diff --git a/java8/docs/JobApi.md b/java8/docs/JobApi.md deleted file mode 100644 index ece4877..0000000 --- a/java8/docs/JobApi.md +++ /dev/null @@ -1,284 +0,0 @@ -# JobApi - -All URIs are relative to *https://gw.api.cloud.sphereon.com/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getJob**](JobApi.md#getJob) | **GET** /template/processor/0.1/jobs/{jobId} | Job definition and state -[**getJobs**](JobApi.md#getJobs) | **GET** /template/processor/0.1/jobs | Get all jobs -[**getResultStreamById**](JobApi.md#getResultStreamById) | **PUT** /template/processor/0.1/jobs/{jobId}/result/file/{streamId} | Get the result file -[**getResultStreamsAsContainer**](JobApi.md#getResultStreamsAsContainer) | **PUT** /template/processor/0.1/jobs/{jobId}/result/container | Get the result file -[**submitJob**](JobApi.md#submitJob) | **PUT** /template/processor/0.1/jobs | Submit merge job for processing - - - -# **getJob** -> MergeJobResponse getJob(jobId) - -Job definition and state - -Get the merge job definition and current state. Please not that you can differentiate based on http response status - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.JobApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -JobApi apiInstance = new JobApi(); -String jobId = "jobId_example"; // String | jobId -try { - MergeJobResponse result = apiInstance.getJob(jobId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling JobApi#getJob"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **String**| jobId | - -### Return type - -[**MergeJobResponse**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - - -# **getJobs** -> List<MergeJobResponse> getJobs(status) - -Get all jobs - -Get all office text job definitions and their current state. - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.JobApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -JobApi apiInstance = new JobApi(); -List status = Arrays.asList("status_example"); // List | A list of status to filter on. -try { - List result = apiInstance.getJobs(status); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling JobApi#getJobs"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| A list of status to filter on. | [optional] [enum: CREATED, UPDATED, PROCESSING, DONE, ERROR, DELETED] - -### Return type - -[**List<MergeJobResponse>**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - - -# **getResultStreamById** -> byte[] getResultStreamById(jobId, streamId, outputSettings) - -Get the result file - -Get a merge result document as a binary stream. - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.JobApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -JobApi apiInstance = new JobApi(); -String jobId = "jobId_example"; // String | jobId -String streamId = "streamId_example"; // String | streamId -OutputSettings outputSettings = new OutputSettings(); // OutputSettings | outputSettings -try { - byte[] result = apiInstance.getResultStreamById(jobId, streamId, outputSettings); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling JobApi#getResultStreamById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **String**| jobId | - **streamId** | **String**| streamId | - **outputSettings** | [**OutputSettings**](OutputSettings.md)| outputSettings | [optional] - -### Return type - -**byte[]** - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/octet-stream - - -# **getResultStreamsAsContainer** -> byte[] getResultStreamsAsContainer(jobId, outputSettings) - -Get the result file - -Get all documents inside a compressed container as a binary stream. - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.JobApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -JobApi apiInstance = new JobApi(); -String jobId = "jobId_example"; // String | jobId -OutputSettings outputSettings = new OutputSettings(); // OutputSettings | outputSettings -try { - byte[] result = apiInstance.getResultStreamsAsContainer(jobId, outputSettings); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling JobApi#getResultStreamsAsContainer"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **String**| jobId | - **outputSettings** | [**OutputSettings**](OutputSettings.md)| outputSettings | [optional] - -### Return type - -**byte[]** - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/octet-stream - - -# **submitJob** -> MergeJobResponse submitJob(mergesettings) - -Submit merge job for processing - -Submit merge job run. - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.JobApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -JobApi apiInstance = new JobApi(); -MergeSettings mergesettings = new MergeSettings(); // MergeSettings | The merge- and output settings -try { - MergeJobResponse result = apiInstance.submitJob(mergesettings); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling JobApi#submitJob"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **mergesettings** | [**MergeSettings**](MergeSettings.md)| The merge- and output settings | - -### Return type - -[**MergeJobResponse**](MergeJobResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - diff --git a/java8/docs/Lifecycle.md b/java8/docs/Lifecycle.md deleted file mode 100644 index b53a347..0000000 --- a/java8/docs/Lifecycle.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Lifecycle - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actionTime** | [**OffsetDateTime**](OffsetDateTime.md) | The time at which the job and files will be deleted, regardless of whether it has been retrieved or not. Maximal time is 1 day from job creation | [optional] -**action** | [**ActionEnum**](#ActionEnum) | | [optional] -**type** | [**TypeEnum**](#TypeEnum) | | [optional] - - - -## Enum: ActionEnum -Name | Value ----- | ----- -DELETE | "DELETE" - - - -## Enum: TypeEnum -Name | Value ----- | ----- -RETRIEVAL | "RETRIEVAL" -TIME | "TIME" - - - diff --git a/java8/docs/MergeJob.md b/java8/docs/MergeJob.md deleted file mode 100644 index 1cebcea..0000000 --- a/java8/docs/MergeJob.md +++ /dev/null @@ -1,32 +0,0 @@ - -# MergeJob - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**resultFolderPath** | **String** | The target folder path of result files | [optional] -**completionTime** | [**OffsetDateTime**](OffsetDateTime.md) | The completion date/time of this job in ISO 8601 format | [optional] -**jobId** | **String** | The server generated job jobId. This jobId is checked against the jobId in the request path on every invocation | -**resultContainerId** | **String** | The target container id of result files | [optional] -**creationTime** | [**OffsetDateTime**](OffsetDateTime.md) | The creation date/time of this job in ISO 8601 format | [optional] -**dataSetId** | **String** | Data set id | [optional] -**resultStreams** | [**List<StreamLocation>**](StreamLocation.md) | The storage locations of the result files. | -**headerDataSetIds** | **List<String>** | Header data set ids | [optional] -**mergeSettings** | [**MergeSettings**](MergeSettings.md) | | [optional] -**statusMessage** | **String** | A status message, which can be informational, warning or error. A message here does not indicate an error perse | [optional] -**status** | [**StatusEnum**](#StatusEnum) | The status of the job | - - - -## Enum: StatusEnum -Name | Value ----- | ----- -CREATED | "CREATED" -UPDATED | "UPDATED" -PROCESSING | "PROCESSING" -DONE | "DONE" -ERROR | "ERROR" -DELETED | "DELETED" - - - diff --git a/java8/docs/MergeJobResponse.md b/java8/docs/MergeJobResponse.md deleted file mode 100644 index 9926809..0000000 --- a/java8/docs/MergeJobResponse.md +++ /dev/null @@ -1,25 +0,0 @@ - -# MergeJobResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**jobId** | **String** | The server generated job jobId. This jobId is checked against the jobId in the request path on overy invocation | -**job** | [**MergeJob**](MergeJob.md) | | [optional] -**statusMessage** | **String** | A status message, which can be informational, warning or error. AA message here does not indicate an error perse | [optional] -**status** | [**StatusEnum**](#StatusEnum) | The status of the job | - - - -## Enum: StatusEnum -Name | Value ----- | ----- -CREATED | "CREATED" -UPDATED | "UPDATED" -PROCESSING | "PROCESSING" -DONE | "DONE" -ERROR | "ERROR" -DELETED | "DELETED" - - - diff --git a/java8/docs/MergeSettings.md b/java8/docs/MergeSettings.md deleted file mode 100644 index 3192e2d..0000000 --- a/java8/docs/MergeSettings.md +++ /dev/null @@ -1,34 +0,0 @@ - -# MergeSettings - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**lifecycle** | [**Lifecycle**](Lifecycle.md) | | [optional] -**mergeResult** | [**MergeResultEnum**](#MergeResultEnum) | | [optional] -**dataSetId** | **String** | Data set id | -**engine** | [**EngineEnum**](#EngineEnum) | | [optional] -**headerDataSetIds** | **List<String>** | optional header data set ids | [optional] -**templateVersion** | **Integer** | Template version | [optional] -**resultStreamLocation** | [**StreamLocation**](StreamLocation.md) | The output location of the result files. | -**templateId** | **String** | Template id | -**outputSettings** | [**OutputSettings**](OutputSettings.md) | | - - - -## Enum: MergeResultEnum -Name | Value ----- | ----- -SINGLE_FILE | "SINGLE_FILE" -SEPARATE_FILES | "SEPARATE_FILES" - - - -## Enum: EngineEnum -Name | Value ----- | ----- -BASIC | "BASIC" -PREMIUM | "PREMIUM" - - - diff --git a/java8/docs/OutputSettings.md b/java8/docs/OutputSettings.md deleted file mode 100644 index e1a9c9e..0000000 --- a/java8/docs/OutputSettings.md +++ /dev/null @@ -1,42 +0,0 @@ - -# OutputSettings - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deliveryFormat** | [**DeliveryFormatEnum**](#DeliveryFormatEnum) | | [optional] -**outputFormat** | [**OutputFormatEnum**](#OutputFormatEnum) | | [optional] - - - -## Enum: DeliveryFormatEnum -Name | Value ----- | ----- -PLAIN | "PLAIN" -ZIP | "ZIP" -_7ZIP | "_7ZIP" - - - -## Enum: OutputFormatEnum -Name | Value ----- | ----- -DOC | "DOC" -DOCX | "DOCX" -RTF | "RTF" -PDF | "PDF" -XPS | "XPS" -SVG | "SVG" -HTML | "HTML" -ODT | "ODT" -TIFF | "TIFF" -PNG | "PNG" -BMP | "BMP" -JPEG | "JPEG" -TXT | "TXT" -XML | "XML" -JSON | "JSON" -DEFAULT | "DEFAULT" - - - diff --git a/java8/docs/OwnerInfo.md b/java8/docs/OwnerInfo.md deleted file mode 100644 index 245929a..0000000 --- a/java8/docs/OwnerInfo.md +++ /dev/null @@ -1,13 +0,0 @@ - -# OwnerInfo - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**phone** | **String** | The owner's phone number | [optional] -**companyDepartment** | **String** | The owner's company/department | [optional] -**name** | **String** | The owner's name | [optional] -**email** | **String** | The owner's email address | [optional] - - - diff --git a/java8/docs/StreamLocation.md b/java8/docs/StreamLocation.md deleted file mode 100644 index 9bfe3a2..0000000 --- a/java8/docs/StreamLocation.md +++ /dev/null @@ -1,13 +0,0 @@ - -# StreamLocation - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**folderPath** | **String** | | [optional] -**originalFileName** | **String** | | [optional] -**containerId** | **String** | | [optional] -**fileId** | **String** | | [optional] - - - diff --git a/java8/docs/TemplateApi.md b/java8/docs/TemplateApi.md deleted file mode 100644 index 0351cfd..0000000 --- a/java8/docs/TemplateApi.md +++ /dev/null @@ -1,280 +0,0 @@ -# TemplateApi - -All URIs are relative to *https://gw.api.cloud.sphereon.com/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createTemplateContext**](TemplateApi.md#createTemplateContext) | **POST** /template/processor/0.1/templates | Create template context -[**deleteTemplateContext**](TemplateApi.md#deleteTemplateContext) | **DELETE** /template/processor/0.1/templates/{templateId} | Delete template context -[**getTemplateContext**](TemplateApi.md#getTemplateContext) | **GET** /template/processor/0.1/templates/{templateId} | Get template context -[**updateTemplateContext**](TemplateApi.md#updateTemplateContext) | **PUT** /template/processor/0.1/templates | Update template context -[**uploadTemplateFile**](TemplateApi.md#uploadTemplateFile) | **POST** /template/processor/0.1/templates/{templateId} | Upload template file - - - -# **createTemplateContext** -> TemplateContextResponse createTemplateContext(templateRequest) - -Create template context - -Create a unique template context for your environment - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.TemplateApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -TemplateApi apiInstance = new TemplateApi(); -TemplateContextRequest templateRequest = new TemplateContextRequest(); // TemplateContextRequest | The template request -try { - TemplateContextResponse result = apiInstance.createTemplateContext(templateRequest); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling TemplateApi#createTemplateContext"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateRequest** | [**TemplateContextRequest**](TemplateContextRequest.md)| The template request | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - - -# **deleteTemplateContext** -> TemplateContextResponse deleteTemplateContext(templateId) - -Delete template context - -Delete a template context with all history - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.TemplateApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -TemplateApi apiInstance = new TemplateApi(); -String templateId = "templateId_example"; // String | templateId -try { - TemplateContextResponse result = apiInstance.deleteTemplateContext(templateId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling TemplateApi#deleteTemplateContext"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **String**| templateId | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - - -# **getTemplateContext** -> TemplateContextResponse getTemplateContext(templateId) - -Get template context - -Get an existing template context - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.TemplateApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -TemplateApi apiInstance = new TemplateApi(); -String templateId = "templateId_example"; // String | The template context name unique for your environment -try { - TemplateContextResponse result = apiInstance.getTemplateContext(templateId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling TemplateApi#getTemplateContext"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **String**| The template context name unique for your environment | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json;charset=UTF-8 - - -# **updateTemplateContext** -> TemplateContextResponse updateTemplateContext(templateContextRequest) - -Update template context - -Update an existing template context for your environment - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.TemplateApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -TemplateApi apiInstance = new TemplateApi(); -TemplateContextRequest templateContextRequest = new TemplateContextRequest(); // TemplateContextRequest | templateContextRequest -try { - TemplateContextResponse result = apiInstance.updateTemplateContext(templateContextRequest); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling TemplateApi#updateTemplateContext"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateContextRequest** | [**TemplateContextRequest**](TemplateContextRequest.md)| templateContextRequest | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: application/json;charset=UTF-8 - - **Accept**: application/json;charset=UTF-8 - - -# **uploadTemplateFile** -> TemplateContextResponse uploadTemplateFile(templateId, stream) - -Upload template file - -Upload the Office template file - -### Example -```java -// Import classes: -//import com.sphereon.sdk.template.processor.handler.ApiClient; -//import com.sphereon.sdk.template.processor.handler.ApiException; -//import com.sphereon.sdk.template.processor.handler.Configuration; -//import com.sphereon.sdk.template.processor.handler.auth.*; -//import com.sphereon.sdk.template.processor.api.TemplateApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: oauth2schema -OAuth oauth2schema = (OAuth) defaultClient.getAuthentication("oauth2schema"); -oauth2schema.setAccessToken("YOUR ACCESS TOKEN"); - -TemplateApi apiInstance = new TemplateApi(); -String templateId = "templateId_example"; // String | The template context name unique for your environment -File stream = new File("/path/to/file.txt"); // File | The template (file/inputstream) to store -try { - TemplateContextResponse result = apiInstance.uploadTemplateFile(templateId, stream); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling TemplateApi#uploadTemplateFile"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **templateId** | **String**| The template context name unique for your environment | - **stream** | **File**| The template (file/inputstream) to store | - -### Return type - -[**TemplateContextResponse**](TemplateContextResponse.md) - -### Authorization - -[oauth2schema](../README.md#oauth2schema) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json;charset=UTF-8 - diff --git a/java8/docs/TemplateContext.md b/java8/docs/TemplateContext.md deleted file mode 100644 index e0e23c7..0000000 --- a/java8/docs/TemplateContext.md +++ /dev/null @@ -1,23 +0,0 @@ - -# TemplateContext - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**templateType** | [**TemplateTypeEnum**](#TemplateTypeEnum) | | -**templateFileLocations** | [**Map<String, StreamLocation>**](StreamLocation.md) | The template files (versioned) | [optional] -**description** | **String** | The template description | [optional] -**ownerInfo** | [**OwnerInfo**](OwnerInfo.md) | | [optional] -**id** | **String** | | [optional] -**templateId** | **String** | The template context id | [optional] - - - -## Enum: TemplateTypeEnum -Name | Value ----- | ----- -OFFICE | "OFFICE" -FREEMARKER | "FREEMARKER" - - - diff --git a/java8/docs/TemplateContextRequest.md b/java8/docs/TemplateContextRequest.md deleted file mode 100644 index 534cbd2..0000000 --- a/java8/docs/TemplateContextRequest.md +++ /dev/null @@ -1,21 +0,0 @@ - -# TemplateContextRequest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**templateType** | [**TemplateTypeEnum**](#TemplateTypeEnum) | | -**description** | **String** | | [optional] -**ownerInfo** | [**OwnerInfo**](OwnerInfo.md) | | [optional] -**templateId** | **String** | The template context id | [optional] - - - -## Enum: TemplateTypeEnum -Name | Value ----- | ----- -OFFICE | "OFFICE" -FREEMARKER | "FREEMARKER" - - - diff --git a/java8/docs/TemplateContextResponse.md b/java8/docs/TemplateContextResponse.md deleted file mode 100644 index 8814408..0000000 --- a/java8/docs/TemplateContextResponse.md +++ /dev/null @@ -1,23 +0,0 @@ - -# TemplateContextResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**creationTime** | [**OffsetDateTime**](OffsetDateTime.md) | The creation date/time of this response in ISO 8601 format | [optional] -**context** | [**TemplateContext**](TemplateContext.md) | | [optional] -**id** | **String** | Unique template context id | -**status** | [**StatusEnum**](#StatusEnum) | The status of the template | - - - -## Enum: StatusEnum -Name | Value ----- | ----- -CREATED | "CREATED" -UPDATED | "UPDATED" -DELETED | "DELETED" -PROCESSING | "PROCESSING" - - - diff --git a/java8/pom.xml b/java8/pom.xml deleted file mode 100644 index 15bbd2c..0000000 --- a/java8/pom.xml +++ /dev/null @@ -1,168 +0,0 @@ - - 4.0.0 - - com.sphereon.sdk - template-processor-sdk-generator - ../pom.xml - 0.1.3-SNAPSHOT - - template-processor-sdk-java8 - jar - template-processor-sdk-java8 - - - - sphereon-sdk-releases - http://nexus.qa.sphereon.com/nexus/content/repositories/sphereon-sdk-releases - - - sphereon-sdk-snapshots - http://nexus.qa.sphereon.com/nexus/content/repositories/sphereon-sdk-snapshots - - - - - - - - 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 - - - - - - - - - - io.swagger - 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} - - - - - junit - junit - ${junit-version} - test - - - - org.apache.commons - commons-io - 1.3.2 - test - - - - org.apache.tika - tika-core - test - ${tika-core.version} - - - - - UTF-8 - 1.8 - ${java.version} - ${java.version} - 1.5.9 - 2.7.5 - 2.6.2 - 2.9.3 - 1.0.0 - 4.12 - UTF-8 - 1.6 - - diff --git a/java8/settings.gradle b/java8/settings.gradle deleted file mode 100644 index ef6e44d..0000000 --- a/java8/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "office-text-sdk-java8" \ No newline at end of file diff --git a/java8/src/main/AndroidManifest.xml b/java8/src/main/AndroidManifest.xml deleted file mode 100644 index 9547d91..0000000 --- a/java8/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/java8/src/main/java/com/sphereon/sdk/template/processor/api/AllApi.java b/java8/src/main/java/com/sphereon/sdk/template/processor/api/AllApi.java deleted file mode 100644 index d49f2ab..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/api/AllApi.java +++ /dev/null @@ -1,1483 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.api; - -import com.sphereon.sdk.template.processor.handler.ApiCallback; -import com.sphereon.sdk.template.processor.handler.ApiClient; -import com.sphereon.sdk.template.processor.handler.ApiException; -import com.sphereon.sdk.template.processor.handler.ApiResponse; -import com.sphereon.sdk.template.processor.handler.Configuration; -import com.sphereon.sdk.template.processor.handler.Pair; -import com.sphereon.sdk.template.processor.handler.ProgressRequestBody; -import com.sphereon.sdk.template.processor.handler.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - -import com.sphereon.sdk.template.processor.model.DataSetResponse; -import com.sphereon.sdk.template.processor.model.ErrorResponse; -import com.sphereon.sdk.template.processor.model.TemplateContextResponse; -import com.sphereon.sdk.template.processor.model.TemplateContextRequest; -import com.sphereon.sdk.template.processor.model.MergeJobResponse; -import com.sphereon.sdk.template.processor.model.OutputSettings; -import com.sphereon.sdk.template.processor.model.MergeSettings; -import java.io.File; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AllApi { - private ApiClient apiClient; - - public AllApi() { - this(Configuration.getDefaultApiClient()); - } - - public AllApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /* Build call for createDataSet */ - private com.squareup.okhttp.Call createDataSetCall(String payload, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = payload; - - // verify the required parameter 'payload' is set - if (payload == null) { - throw new ApiException("Missing the required parameter 'payload' when calling createDataSet(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/datasets".replaceAll("\\{format\\}","json"); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Store dataset - * Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - * @param payload The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] (required) - * @return DataSetResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public DataSetResponse createDataSet(String payload) throws ApiException { - ApiResponse resp = createDataSetWithHttpInfo(payload); - return resp.getData(); - } - - /** - * Store dataset - * Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - * @param payload The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] (required) - * @return ApiResponse<DataSetResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse createDataSetWithHttpInfo(String payload) throws ApiException { - com.squareup.okhttp.Call call = createDataSetCall(payload, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Store dataset (asynchronously) - * Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - * @param payload The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] (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 createDataSetAsync(String payload, 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 = createDataSetCall(payload, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for createTemplateContext */ - private com.squareup.okhttp.Call createTemplateContextCall(TemplateContextRequest templateRequest, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = templateRequest; - - // verify the required parameter 'templateRequest' is set - if (templateRequest == null) { - throw new ApiException("Missing the required parameter 'templateRequest' when calling createTemplateContext(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/templates".replaceAll("\\{format\\}","json"); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Create template context - * Create a unique template context for your environment - * @param templateRequest The template request (required) - * @return TemplateContextResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public TemplateContextResponse createTemplateContext(TemplateContextRequest templateRequest) throws ApiException { - ApiResponse resp = createTemplateContextWithHttpInfo(templateRequest); - return resp.getData(); - } - - /** - * Create template context - * Create a unique template context for your environment - * @param templateRequest The template request (required) - * @return ApiResponse<TemplateContextResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse createTemplateContextWithHttpInfo(TemplateContextRequest templateRequest) throws ApiException { - com.squareup.okhttp.Call call = createTemplateContextCall(templateRequest, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Create template context (asynchronously) - * Create a unique template context for your environment - * @param templateRequest The template request (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 createTemplateContextAsync(TemplateContextRequest templateRequest, 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 = createTemplateContextCall(templateRequest, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for deleteDataSet */ - private com.squareup.okhttp.Call deleteDataSetCall(String dataSetId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'dataSetId' is set - if (dataSetId == null) { - throw new ApiException("Missing the required parameter 'dataSetId' when calling deleteDataSet(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/datasets/{dataSetId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "dataSetId" + "\\}", apiClient.escapeString(dataSetId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Delete a stored data set - * Delete a stored data set - * @param dataSetId dataSetId (required) - * @return DataSetResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public DataSetResponse deleteDataSet(String dataSetId) throws ApiException { - ApiResponse resp = deleteDataSetWithHttpInfo(dataSetId); - return resp.getData(); - } - - /** - * Delete a stored data set - * Delete a stored data set - * @param dataSetId dataSetId (required) - * @return ApiResponse<DataSetResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse deleteDataSetWithHttpInfo(String dataSetId) throws ApiException { - com.squareup.okhttp.Call call = deleteDataSetCall(dataSetId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Delete a stored data set (asynchronously) - * Delete a stored data set - * @param dataSetId dataSetId (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 deleteDataSetAsync(String dataSetId, 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 = deleteDataSetCall(dataSetId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for deleteJob */ - private com.squareup.okhttp.Call deleteJobCall(String jobId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'jobId' is set - if (jobId == null) { - throw new ApiException("Missing the required parameter 'jobId' when calling deleteJob(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/jobs/{jobId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "jobId" + "\\}", apiClient.escapeString(jobId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Delete a job manually - * Delete the merge job and all related files - * @param jobId jobId (required) - * @return MergeJobResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public MergeJobResponse deleteJob(String jobId) throws ApiException { - ApiResponse resp = deleteJobWithHttpInfo(jobId); - return resp.getData(); - } - - /** - * Delete a job manually - * Delete the merge job and all related files - * @param jobId jobId (required) - * @return ApiResponse<MergeJobResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse deleteJobWithHttpInfo(String jobId) throws ApiException { - com.squareup.okhttp.Call call = deleteJobCall(jobId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Delete a job manually (asynchronously) - * Delete the merge job and all related files - * @param jobId jobId (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 deleteJobAsync(String jobId, 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 = deleteJobCall(jobId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for deleteTemplateContext */ - private com.squareup.okhttp.Call deleteTemplateContextCall(String templateId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set - if (templateId == null) { - throw new ApiException("Missing the required parameter 'templateId' when calling deleteTemplateContext(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/templates/{templateId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Delete template context - * Delete a template context with all history - * @param templateId templateId (required) - * @return TemplateContextResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public TemplateContextResponse deleteTemplateContext(String templateId) throws ApiException { - ApiResponse resp = deleteTemplateContextWithHttpInfo(templateId); - return resp.getData(); - } - - /** - * Delete template context - * Delete a template context with all history - * @param templateId templateId (required) - * @return ApiResponse<TemplateContextResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse deleteTemplateContextWithHttpInfo(String templateId) throws ApiException { - com.squareup.okhttp.Call call = deleteTemplateContextCall(templateId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Delete template context (asynchronously) - * Delete a template context with all history - * @param templateId templateId (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 deleteTemplateContextAsync(String templateId, 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 = deleteTemplateContextCall(templateId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for getJob */ - private com.squareup.okhttp.Call getJobCall(String jobId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'jobId' is set - if (jobId == null) { - throw new ApiException("Missing the required parameter 'jobId' when calling getJob(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/jobs/{jobId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "jobId" + "\\}", apiClient.escapeString(jobId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Job definition and state - * Get the merge job definition and current state. Please not that you can differentiate based on http response status - * @param jobId jobId (required) - * @return MergeJobResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public MergeJobResponse getJob(String jobId) throws ApiException { - ApiResponse resp = getJobWithHttpInfo(jobId); - return resp.getData(); - } - - /** - * Job definition and state - * Get the merge job definition and current state. Please not that you can differentiate based on http response status - * @param jobId jobId (required) - * @return ApiResponse<MergeJobResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getJobWithHttpInfo(String jobId) throws ApiException { - com.squareup.okhttp.Call call = getJobCall(jobId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Job definition and state (asynchronously) - * Get the merge job definition and current state. Please not that you can differentiate based on http response status - * @param jobId jobId (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 getJobAsync(String jobId, 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 = getJobCall(jobId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for getJobs */ - private com.squareup.okhttp.Call getJobsCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - - // create path and map variables - String localVarPath = "/template/processor/0.1/jobs".replaceAll("\\{format\\}","json"); - - List localVarQueryParams = new ArrayList(); - if (status != null) - localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status)); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Get all jobs - * Get all office text job definitions and their current state. - * @param status A list of status to filter on. (optional) - * @return List<MergeJobResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public List getJobs(List status) throws ApiException { - ApiResponse> resp = getJobsWithHttpInfo(status); - return resp.getData(); - } - - /** - * Get all jobs - * Get all office text job definitions and their current state. - * @param status A list of status to filter on. (optional) - * @return ApiResponse<List<MergeJobResponse>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse> getJobsWithHttpInfo(List status) throws ApiException { - com.squareup.okhttp.Call call = getJobsCall(status, null, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get all jobs (asynchronously) - * Get all office text job definitions and their current state. - * @param status A list of status to filter on. (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 getJobsAsync(List status, 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 = getJobsCall(status, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken>(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for getResultStreamById */ - private com.squareup.okhttp.Call getResultStreamByIdCall(String jobId, String streamId, OutputSettings outputSettings, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = outputSettings; - - // verify the required parameter 'jobId' is set - if (jobId == null) { - throw new ApiException("Missing the required parameter 'jobId' when calling getResultStreamById(Async)"); - } - - // verify the required parameter 'streamId' is set - if (streamId == null) { - throw new ApiException("Missing the required parameter 'streamId' when calling getResultStreamById(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/jobs/{jobId}/result/file/{streamId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "jobId" + "\\}", apiClient.escapeString(jobId.toString())) - .replaceAll("\\{" + "streamId" + "\\}", apiClient.escapeString(streamId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/octet-stream" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Get the result file - * Get a merge result document as a binary stream. - * @param jobId jobId (required) - * @param streamId streamId (required) - * @param outputSettings outputSettings (optional) - * @return byte[] - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public byte[] getResultStreamById(String jobId, String streamId, OutputSettings outputSettings) throws ApiException { - ApiResponse resp = getResultStreamByIdWithHttpInfo(jobId, streamId, outputSettings); - return resp.getData(); - } - - /** - * Get the result file - * Get a merge result document as a binary stream. - * @param jobId jobId (required) - * @param streamId streamId (required) - * @param outputSettings outputSettings (optional) - * @return ApiResponse<byte[]> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getResultStreamByIdWithHttpInfo(String jobId, String streamId, OutputSettings outputSettings) throws ApiException { - com.squareup.okhttp.Call call = getResultStreamByIdCall(jobId, streamId, outputSettings, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get the result file (asynchronously) - * Get a merge result document as a binary stream. - * @param jobId jobId (required) - * @param streamId streamId (required) - * @param outputSettings outputSettings (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 getResultStreamByIdAsync(String jobId, String streamId, OutputSettings outputSettings, 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 = getResultStreamByIdCall(jobId, streamId, outputSettings, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for getResultStreamsAsContainer */ - private com.squareup.okhttp.Call getResultStreamsAsContainerCall(String jobId, OutputSettings outputSettings, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = outputSettings; - - // verify the required parameter 'jobId' is set - if (jobId == null) { - throw new ApiException("Missing the required parameter 'jobId' when calling getResultStreamsAsContainer(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/jobs/{jobId}/result/container".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "jobId" + "\\}", apiClient.escapeString(jobId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/octet-stream" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Get the result file - * Get all documents inside a compressed container as a binary stream. - * @param jobId jobId (required) - * @param outputSettings outputSettings (optional) - * @return byte[] - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public byte[] getResultStreamsAsContainer(String jobId, OutputSettings outputSettings) throws ApiException { - ApiResponse resp = getResultStreamsAsContainerWithHttpInfo(jobId, outputSettings); - return resp.getData(); - } - - /** - * Get the result file - * Get all documents inside a compressed container as a binary stream. - * @param jobId jobId (required) - * @param outputSettings outputSettings (optional) - * @return ApiResponse<byte[]> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getResultStreamsAsContainerWithHttpInfo(String jobId, OutputSettings outputSettings) throws ApiException { - com.squareup.okhttp.Call call = getResultStreamsAsContainerCall(jobId, outputSettings, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get the result file (asynchronously) - * Get all documents inside a compressed container as a binary stream. - * @param jobId jobId (required) - * @param outputSettings outputSettings (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 getResultStreamsAsContainerAsync(String jobId, OutputSettings outputSettings, 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 = getResultStreamsAsContainerCall(jobId, outputSettings, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for getTemplateContext */ - private com.squareup.okhttp.Call getTemplateContextCall(String templateId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set - if (templateId == null) { - throw new ApiException("Missing the required parameter 'templateId' when calling getTemplateContext(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/templates/{templateId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Get template context - * Get an existing template context - * @param templateId The template context name unique for your environment (required) - * @return TemplateContextResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public TemplateContextResponse getTemplateContext(String templateId) throws ApiException { - ApiResponse resp = getTemplateContextWithHttpInfo(templateId); - return resp.getData(); - } - - /** - * Get template context - * Get an existing template context - * @param templateId The template context name unique for your environment (required) - * @return ApiResponse<TemplateContextResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getTemplateContextWithHttpInfo(String templateId) throws ApiException { - com.squareup.okhttp.Call call = getTemplateContextCall(templateId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get template context (asynchronously) - * Get an existing template context - * @param templateId The template context name unique for your environment (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 getTemplateContextAsync(String templateId, 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 = getTemplateContextCall(templateId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for submitJob */ - private com.squareup.okhttp.Call submitJobCall(MergeSettings mergesettings, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = mergesettings; - - // verify the required parameter 'mergesettings' is set - if (mergesettings == null) { - throw new ApiException("Missing the required parameter 'mergesettings' when calling submitJob(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/jobs".replaceAll("\\{format\\}","json"); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Submit merge job for processing - * Submit merge job run. - * @param mergesettings The merge- and output settings (required) - * @return MergeJobResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public MergeJobResponse submitJob(MergeSettings mergesettings) throws ApiException { - ApiResponse resp = submitJobWithHttpInfo(mergesettings); - return resp.getData(); - } - - /** - * Submit merge job for processing - * Submit merge job run. - * @param mergesettings The merge- and output settings (required) - * @return ApiResponse<MergeJobResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse submitJobWithHttpInfo(MergeSettings mergesettings) throws ApiException { - com.squareup.okhttp.Call call = submitJobCall(mergesettings, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Submit merge job for processing (asynchronously) - * Submit merge job run. - * @param mergesettings The merge- and output settings (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 submitJobAsync(MergeSettings mergesettings, 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 = submitJobCall(mergesettings, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for updateTemplateContext */ - private com.squareup.okhttp.Call updateTemplateContextCall(TemplateContextRequest templateContextRequest, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = templateContextRequest; - - // verify the required parameter 'templateContextRequest' is set - if (templateContextRequest == null) { - throw new ApiException("Missing the required parameter 'templateContextRequest' when calling updateTemplateContext(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/templates".replaceAll("\\{format\\}","json"); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Update template context - * Update an existing template context for your environment - * @param templateContextRequest templateContextRequest (required) - * @return TemplateContextResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public TemplateContextResponse updateTemplateContext(TemplateContextRequest templateContextRequest) throws ApiException { - ApiResponse resp = updateTemplateContextWithHttpInfo(templateContextRequest); - return resp.getData(); - } - - /** - * Update template context - * Update an existing template context for your environment - * @param templateContextRequest templateContextRequest (required) - * @return ApiResponse<TemplateContextResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse updateTemplateContextWithHttpInfo(TemplateContextRequest templateContextRequest) throws ApiException { - com.squareup.okhttp.Call call = updateTemplateContextCall(templateContextRequest, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Update template context (asynchronously) - * Update an existing template context for your environment - * @param templateContextRequest templateContextRequest (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 updateTemplateContextAsync(TemplateContextRequest templateContextRequest, 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 = updateTemplateContextCall(templateContextRequest, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for uploadTemplateFile */ - private com.squareup.okhttp.Call uploadTemplateFileCall(String templateId, File stream, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set - if (templateId == null) { - throw new ApiException("Missing the required parameter 'templateId' when calling uploadTemplateFile(Async)"); - } - - // verify the required parameter 'stream' is set - if (stream == null) { - throw new ApiException("Missing the required parameter 'stream' when calling uploadTemplateFile(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/templates/{templateId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - if (stream != null) - localVarFormParams.put("stream", stream); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Upload template file - * Upload the Office template file - * @param templateId The template context name unique for your environment (required) - * @param stream The template (file/inputstream) to store (required) - * @return TemplateContextResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public TemplateContextResponse uploadTemplateFile(String templateId, File stream) throws ApiException { - ApiResponse resp = uploadTemplateFileWithHttpInfo(templateId, stream); - return resp.getData(); - } - - /** - * Upload template file - * Upload the Office template file - * @param templateId The template context name unique for your environment (required) - * @param stream The template (file/inputstream) to store (required) - * @return ApiResponse<TemplateContextResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse uploadTemplateFileWithHttpInfo(String templateId, File stream) throws ApiException { - com.squareup.okhttp.Call call = uploadTemplateFileCall(templateId, stream, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Upload template file (asynchronously) - * Upload the Office template file - * @param templateId The template context name unique for your environment (required) - * @param stream The template (file/inputstream) to store (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 uploadTemplateFileAsync(String templateId, File stream, 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 = uploadTemplateFileCall(templateId, stream, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } -} diff --git a/java8/src/main/java/com/sphereon/sdk/template/processor/api/DataSetApi.java b/java8/src/main/java/com/sphereon/sdk/template/processor/api/DataSetApi.java deleted file mode 100644 index 9c8de9b..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/api/DataSetApi.java +++ /dev/null @@ -1,282 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.api; - -import com.sphereon.sdk.template.processor.handler.ApiCallback; -import com.sphereon.sdk.template.processor.handler.ApiClient; -import com.sphereon.sdk.template.processor.handler.ApiException; -import com.sphereon.sdk.template.processor.handler.ApiResponse; -import com.sphereon.sdk.template.processor.handler.Configuration; -import com.sphereon.sdk.template.processor.handler.Pair; -import com.sphereon.sdk.template.processor.handler.ProgressRequestBody; -import com.sphereon.sdk.template.processor.handler.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - -import com.sphereon.sdk.template.processor.model.DataSetResponse; -import com.sphereon.sdk.template.processor.model.ErrorResponse; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class DataSetApi { - private ApiClient apiClient; - - public DataSetApi() { - this(Configuration.getDefaultApiClient()); - } - - public DataSetApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /* Build call for createDataSet */ - private com.squareup.okhttp.Call createDataSetCall(String payload, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = payload; - - // verify the required parameter 'payload' is set - if (payload == null) { - throw new ApiException("Missing the required parameter 'payload' when calling createDataSet(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/datasets".replaceAll("\\{format\\}","json"); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Store dataset - * Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - * @param payload The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] (required) - * @return DataSetResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public DataSetResponse createDataSet(String payload) throws ApiException { - ApiResponse resp = createDataSetWithHttpInfo(payload); - return resp.getData(); - } - - /** - * Store dataset - * Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - * @param payload The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] (required) - * @return ApiResponse<DataSetResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse createDataSetWithHttpInfo(String payload) throws ApiException { - com.squareup.okhttp.Call call = createDataSetCall(payload, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Store dataset (asynchronously) - * Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - * @param payload The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] (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 createDataSetAsync(String payload, 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 = createDataSetCall(payload, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for deleteDataSet */ - private com.squareup.okhttp.Call deleteDataSetCall(String dataSetId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'dataSetId' is set - if (dataSetId == null) { - throw new ApiException("Missing the required parameter 'dataSetId' when calling deleteDataSet(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/datasets/{dataSetId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "dataSetId" + "\\}", apiClient.escapeString(dataSetId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Delete a stored data set - * Delete a stored data set - * @param dataSetId dataSetId (required) - * @return DataSetResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public DataSetResponse deleteDataSet(String dataSetId) throws ApiException { - ApiResponse resp = deleteDataSetWithHttpInfo(dataSetId); - return resp.getData(); - } - - /** - * Delete a stored data set - * Delete a stored data set - * @param dataSetId dataSetId (required) - * @return ApiResponse<DataSetResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse deleteDataSetWithHttpInfo(String dataSetId) throws ApiException { - com.squareup.okhttp.Call call = deleteDataSetCall(dataSetId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Delete a stored data set (asynchronously) - * Delete a stored data set - * @param dataSetId dataSetId (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 deleteDataSetAsync(String dataSetId, 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 = deleteDataSetCall(dataSetId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } -} diff --git a/java8/src/main/java/com/sphereon/sdk/template/processor/api/JobApi.java b/java8/src/main/java/com/sphereon/sdk/template/processor/api/JobApi.java deleted file mode 100644 index caf8951..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/api/JobApi.java +++ /dev/null @@ -1,616 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.api; - -import com.sphereon.sdk.template.processor.handler.ApiCallback; -import com.sphereon.sdk.template.processor.handler.ApiClient; -import com.sphereon.sdk.template.processor.handler.ApiException; -import com.sphereon.sdk.template.processor.handler.ApiResponse; -import com.sphereon.sdk.template.processor.handler.Configuration; -import com.sphereon.sdk.template.processor.handler.Pair; -import com.sphereon.sdk.template.processor.handler.ProgressRequestBody; -import com.sphereon.sdk.template.processor.handler.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - -import com.sphereon.sdk.template.processor.model.MergeJobResponse; -import com.sphereon.sdk.template.processor.model.ErrorResponse; -import com.sphereon.sdk.template.processor.model.OutputSettings; -import com.sphereon.sdk.template.processor.model.MergeSettings; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class JobApi { - private ApiClient apiClient; - - public JobApi() { - this(Configuration.getDefaultApiClient()); - } - - public JobApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /* Build call for getJob */ - private com.squareup.okhttp.Call getJobCall(String jobId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'jobId' is set - if (jobId == null) { - throw new ApiException("Missing the required parameter 'jobId' when calling getJob(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/jobs/{jobId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "jobId" + "\\}", apiClient.escapeString(jobId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Job definition and state - * Get the merge job definition and current state. Please not that you can differentiate based on http response status - * @param jobId jobId (required) - * @return MergeJobResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public MergeJobResponse getJob(String jobId) throws ApiException { - ApiResponse resp = getJobWithHttpInfo(jobId); - return resp.getData(); - } - - /** - * Job definition and state - * Get the merge job definition and current state. Please not that you can differentiate based on http response status - * @param jobId jobId (required) - * @return ApiResponse<MergeJobResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getJobWithHttpInfo(String jobId) throws ApiException { - com.squareup.okhttp.Call call = getJobCall(jobId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Job definition and state (asynchronously) - * Get the merge job definition and current state. Please not that you can differentiate based on http response status - * @param jobId jobId (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 getJobAsync(String jobId, 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 = getJobCall(jobId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for getJobs */ - private com.squareup.okhttp.Call getJobsCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - - // create path and map variables - String localVarPath = "/template/processor/0.1/jobs".replaceAll("\\{format\\}","json"); - - List localVarQueryParams = new ArrayList(); - if (status != null) - localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status)); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Get all jobs - * Get all office text job definitions and their current state. - * @param status A list of status to filter on. (optional) - * @return List<MergeJobResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public List getJobs(List status) throws ApiException { - ApiResponse> resp = getJobsWithHttpInfo(status); - return resp.getData(); - } - - /** - * Get all jobs - * Get all office text job definitions and their current state. - * @param status A list of status to filter on. (optional) - * @return ApiResponse<List<MergeJobResponse>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse> getJobsWithHttpInfo(List status) throws ApiException { - com.squareup.okhttp.Call call = getJobsCall(status, null, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get all jobs (asynchronously) - * Get all office text job definitions and their current state. - * @param status A list of status to filter on. (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 getJobsAsync(List status, 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 = getJobsCall(status, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken>(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for getResultStreamById */ - private com.squareup.okhttp.Call getResultStreamByIdCall(String jobId, String streamId, OutputSettings outputSettings, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = outputSettings; - - // verify the required parameter 'jobId' is set - if (jobId == null) { - throw new ApiException("Missing the required parameter 'jobId' when calling getResultStreamById(Async)"); - } - - // verify the required parameter 'streamId' is set - if (streamId == null) { - throw new ApiException("Missing the required parameter 'streamId' when calling getResultStreamById(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/jobs/{jobId}/result/file/{streamId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "jobId" + "\\}", apiClient.escapeString(jobId.toString())) - .replaceAll("\\{" + "streamId" + "\\}", apiClient.escapeString(streamId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/octet-stream" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Get the result file - * Get a merge result document as a binary stream. - * @param jobId jobId (required) - * @param streamId streamId (required) - * @param outputSettings outputSettings (optional) - * @return byte[] - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public byte[] getResultStreamById(String jobId, String streamId, OutputSettings outputSettings) throws ApiException { - ApiResponse resp = getResultStreamByIdWithHttpInfo(jobId, streamId, outputSettings); - return resp.getData(); - } - - /** - * Get the result file - * Get a merge result document as a binary stream. - * @param jobId jobId (required) - * @param streamId streamId (required) - * @param outputSettings outputSettings (optional) - * @return ApiResponse<byte[]> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getResultStreamByIdWithHttpInfo(String jobId, String streamId, OutputSettings outputSettings) throws ApiException { - com.squareup.okhttp.Call call = getResultStreamByIdCall(jobId, streamId, outputSettings, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get the result file (asynchronously) - * Get a merge result document as a binary stream. - * @param jobId jobId (required) - * @param streamId streamId (required) - * @param outputSettings outputSettings (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 getResultStreamByIdAsync(String jobId, String streamId, OutputSettings outputSettings, 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 = getResultStreamByIdCall(jobId, streamId, outputSettings, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for getResultStreamsAsContainer */ - private com.squareup.okhttp.Call getResultStreamsAsContainerCall(String jobId, OutputSettings outputSettings, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = outputSettings; - - // verify the required parameter 'jobId' is set - if (jobId == null) { - throw new ApiException("Missing the required parameter 'jobId' when calling getResultStreamsAsContainer(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/jobs/{jobId}/result/container".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "jobId" + "\\}", apiClient.escapeString(jobId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/octet-stream" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Get the result file - * Get all documents inside a compressed container as a binary stream. - * @param jobId jobId (required) - * @param outputSettings outputSettings (optional) - * @return byte[] - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public byte[] getResultStreamsAsContainer(String jobId, OutputSettings outputSettings) throws ApiException { - ApiResponse resp = getResultStreamsAsContainerWithHttpInfo(jobId, outputSettings); - return resp.getData(); - } - - /** - * Get the result file - * Get all documents inside a compressed container as a binary stream. - * @param jobId jobId (required) - * @param outputSettings outputSettings (optional) - * @return ApiResponse<byte[]> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getResultStreamsAsContainerWithHttpInfo(String jobId, OutputSettings outputSettings) throws ApiException { - com.squareup.okhttp.Call call = getResultStreamsAsContainerCall(jobId, outputSettings, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get the result file (asynchronously) - * Get all documents inside a compressed container as a binary stream. - * @param jobId jobId (required) - * @param outputSettings outputSettings (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 getResultStreamsAsContainerAsync(String jobId, OutputSettings outputSettings, 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 = getResultStreamsAsContainerCall(jobId, outputSettings, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for submitJob */ - private com.squareup.okhttp.Call submitJobCall(MergeSettings mergesettings, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = mergesettings; - - // verify the required parameter 'mergesettings' is set - if (mergesettings == null) { - throw new ApiException("Missing the required parameter 'mergesettings' when calling submitJob(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/jobs".replaceAll("\\{format\\}","json"); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Submit merge job for processing - * Submit merge job run. - * @param mergesettings The merge- and output settings (required) - * @return MergeJobResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public MergeJobResponse submitJob(MergeSettings mergesettings) throws ApiException { - ApiResponse resp = submitJobWithHttpInfo(mergesettings); - return resp.getData(); - } - - /** - * Submit merge job for processing - * Submit merge job run. - * @param mergesettings The merge- and output settings (required) - * @return ApiResponse<MergeJobResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse submitJobWithHttpInfo(MergeSettings mergesettings) throws ApiException { - com.squareup.okhttp.Call call = submitJobCall(mergesettings, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Submit merge job for processing (asynchronously) - * Submit merge job run. - * @param mergesettings The merge- and output settings (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 submitJobAsync(MergeSettings mergesettings, 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 = submitJobCall(mergesettings, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } -} diff --git a/java8/src/main/java/com/sphereon/sdk/template/processor/api/TemplateApi.java b/java8/src/main/java/com/sphereon/sdk/template/processor/api/TemplateApi.java deleted file mode 100644 index 7d238db..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/api/TemplateApi.java +++ /dev/null @@ -1,614 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.api; - -import com.sphereon.sdk.template.processor.handler.ApiCallback; -import com.sphereon.sdk.template.processor.handler.ApiClient; -import com.sphereon.sdk.template.processor.handler.ApiException; -import com.sphereon.sdk.template.processor.handler.ApiResponse; -import com.sphereon.sdk.template.processor.handler.Configuration; -import com.sphereon.sdk.template.processor.handler.Pair; -import com.sphereon.sdk.template.processor.handler.ProgressRequestBody; -import com.sphereon.sdk.template.processor.handler.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - -import com.sphereon.sdk.template.processor.model.TemplateContextResponse; -import com.sphereon.sdk.template.processor.model.TemplateContextRequest; -import com.sphereon.sdk.template.processor.model.ErrorResponse; -import java.io.File; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class TemplateApi { - private ApiClient apiClient; - - public TemplateApi() { - this(Configuration.getDefaultApiClient()); - } - - public TemplateApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /* Build call for createTemplateContext */ - private com.squareup.okhttp.Call createTemplateContextCall(TemplateContextRequest templateRequest, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = templateRequest; - - // verify the required parameter 'templateRequest' is set - if (templateRequest == null) { - throw new ApiException("Missing the required parameter 'templateRequest' when calling createTemplateContext(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/templates".replaceAll("\\{format\\}","json"); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Create template context - * Create a unique template context for your environment - * @param templateRequest The template request (required) - * @return TemplateContextResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public TemplateContextResponse createTemplateContext(TemplateContextRequest templateRequest) throws ApiException { - ApiResponse resp = createTemplateContextWithHttpInfo(templateRequest); - return resp.getData(); - } - - /** - * Create template context - * Create a unique template context for your environment - * @param templateRequest The template request (required) - * @return ApiResponse<TemplateContextResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse createTemplateContextWithHttpInfo(TemplateContextRequest templateRequest) throws ApiException { - com.squareup.okhttp.Call call = createTemplateContextCall(templateRequest, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Create template context (asynchronously) - * Create a unique template context for your environment - * @param templateRequest The template request (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 createTemplateContextAsync(TemplateContextRequest templateRequest, 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 = createTemplateContextCall(templateRequest, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for deleteTemplateContext */ - private com.squareup.okhttp.Call deleteTemplateContextCall(String templateId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set - if (templateId == null) { - throw new ApiException("Missing the required parameter 'templateId' when calling deleteTemplateContext(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/templates/{templateId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Delete template context - * Delete a template context with all history - * @param templateId templateId (required) - * @return TemplateContextResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public TemplateContextResponse deleteTemplateContext(String templateId) throws ApiException { - ApiResponse resp = deleteTemplateContextWithHttpInfo(templateId); - return resp.getData(); - } - - /** - * Delete template context - * Delete a template context with all history - * @param templateId templateId (required) - * @return ApiResponse<TemplateContextResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse deleteTemplateContextWithHttpInfo(String templateId) throws ApiException { - com.squareup.okhttp.Call call = deleteTemplateContextCall(templateId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Delete template context (asynchronously) - * Delete a template context with all history - * @param templateId templateId (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 deleteTemplateContextAsync(String templateId, 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 = deleteTemplateContextCall(templateId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for getTemplateContext */ - private com.squareup.okhttp.Call getTemplateContextCall(String templateId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set - if (templateId == null) { - throw new ApiException("Missing the required parameter 'templateId' when calling getTemplateContext(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/templates/{templateId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Get template context - * Get an existing template context - * @param templateId The template context name unique for your environment (required) - * @return TemplateContextResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public TemplateContextResponse getTemplateContext(String templateId) throws ApiException { - ApiResponse resp = getTemplateContextWithHttpInfo(templateId); - return resp.getData(); - } - - /** - * Get template context - * Get an existing template context - * @param templateId The template context name unique for your environment (required) - * @return ApiResponse<TemplateContextResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getTemplateContextWithHttpInfo(String templateId) throws ApiException { - com.squareup.okhttp.Call call = getTemplateContextCall(templateId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get template context (asynchronously) - * Get an existing template context - * @param templateId The template context name unique for your environment (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 getTemplateContextAsync(String templateId, 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 = getTemplateContextCall(templateId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for updateTemplateContext */ - private com.squareup.okhttp.Call updateTemplateContextCall(TemplateContextRequest templateContextRequest, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = templateContextRequest; - - // verify the required parameter 'templateContextRequest' is set - if (templateContextRequest == null) { - throw new ApiException("Missing the required parameter 'templateContextRequest' when calling updateTemplateContext(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/templates".replaceAll("\\{format\\}","json"); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json;charset=UTF-8" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Update template context - * Update an existing template context for your environment - * @param templateContextRequest templateContextRequest (required) - * @return TemplateContextResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public TemplateContextResponse updateTemplateContext(TemplateContextRequest templateContextRequest) throws ApiException { - ApiResponse resp = updateTemplateContextWithHttpInfo(templateContextRequest); - return resp.getData(); - } - - /** - * Update template context - * Update an existing template context for your environment - * @param templateContextRequest templateContextRequest (required) - * @return ApiResponse<TemplateContextResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse updateTemplateContextWithHttpInfo(TemplateContextRequest templateContextRequest) throws ApiException { - com.squareup.okhttp.Call call = updateTemplateContextCall(templateContextRequest, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Update template context (asynchronously) - * Update an existing template context for your environment - * @param templateContextRequest templateContextRequest (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 updateTemplateContextAsync(TemplateContextRequest templateContextRequest, 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 = updateTemplateContextCall(templateContextRequest, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /* Build call for uploadTemplateFile */ - private com.squareup.okhttp.Call uploadTemplateFileCall(String templateId, File stream, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set - if (templateId == null) { - throw new ApiException("Missing the required parameter 'templateId' when calling uploadTemplateFile(Async)"); - } - - // verify the required parameter 'stream' is set - if (stream == null) { - throw new ApiException("Missing the required parameter 'stream' when calling uploadTemplateFile(Async)"); - } - - - // create path and map variables - String localVarPath = "/template/processor/0.1/templates/{templateId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString())); - - List localVarQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - if (stream != null) - localVarFormParams.put("stream", stream); - - final String[] localVarAccepts = { - "application/json;charset=UTF-8" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - 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[] { "oauth2schema" }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - /** - * Upload template file - * Upload the Office template file - * @param templateId The template context name unique for your environment (required) - * @param stream The template (file/inputstream) to store (required) - * @return TemplateContextResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public TemplateContextResponse uploadTemplateFile(String templateId, File stream) throws ApiException { - ApiResponse resp = uploadTemplateFileWithHttpInfo(templateId, stream); - return resp.getData(); - } - - /** - * Upload template file - * Upload the Office template file - * @param templateId The template context name unique for your environment (required) - * @param stream The template (file/inputstream) to store (required) - * @return ApiResponse<TemplateContextResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse uploadTemplateFileWithHttpInfo(String templateId, File stream) throws ApiException { - com.squareup.okhttp.Call call = uploadTemplateFileCall(templateId, stream, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Upload template file (asynchronously) - * Upload the Office template file - * @param templateId The template context name unique for your environment (required) - * @param stream The template (file/inputstream) to store (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 uploadTemplateFileAsync(String templateId, File stream, 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 = uploadTemplateFileCall(templateId, stream, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } -} diff --git a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiException.java b/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiException.java deleted file mode 100644 index c0d87b8..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiException.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler; - -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -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/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiResponse.java b/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiResponse.java deleted file mode 100644 index 82e29e7..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiResponse.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler; - -import java.util.List; -import java.util.Map; - -/** - * API response returned by API call. - * - * @param T 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/java8/src/main/java/com/sphereon/sdk/template/processor/handler/Configuration.java b/java8/src/main/java/com/sphereon/sdk/template/processor/handler/Configuration.java deleted file mode 100644 index 5609537..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/Configuration.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -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/java8/src/main/java/com/sphereon/sdk/template/processor/handler/Pair.java b/java8/src/main/java/com/sphereon/sdk/template/processor/handler/Pair.java deleted file mode 100644 index 01d703a..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/Pair.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -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/java8/src/main/java/com/sphereon/sdk/template/processor/handler/StringUtil.java b/java8/src/main/java/com/sphereon/sdk/template/processor/handler/StringUtil.java deleted file mode 100644 index e7c42e4..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/StringUtil.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -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/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/ApiKeyAuth.java b/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/ApiKeyAuth.java deleted file mode 100644 index 5bc7e7b..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/ApiKeyAuth.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler.auth; - -import com.sphereon.sdk.template.processor.handler.Pair; - -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -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/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/Authentication.java b/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/Authentication.java deleted file mode 100644 index 2518b5d..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/Authentication.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler.auth; - -import com.sphereon.sdk.template.processor.handler.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/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/HttpBasicAuth.java b/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/HttpBasicAuth.java deleted file mode 100644 index ff4ad7b..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/HttpBasicAuth.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler.auth; - -import com.sphereon.sdk.template.processor.handler.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/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/OAuth.java b/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/OAuth.java deleted file mode 100644 index a331877..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/OAuth.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler.auth; - -import com.sphereon.sdk.template.processor.handler.Pair; - -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -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/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/OAuthFlow.java b/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/OAuthFlow.java deleted file mode 100644 index 21577d2..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/auth/OAuthFlow.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler.auth; - -public enum OAuthFlow { - accessCode, implicit, password, application -} diff --git a/java8/src/main/java/com/sphereon/sdk/template/processor/model/DataSetResponse.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/DataSetResponse.java deleted file mode 100644 index cb06683..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/DataSetResponse.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; - - -/** - * The merge template response. - */ -@ApiModel(description = "The merge template response.") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class DataSetResponse { - @SerializedName("completionTime") - private OffsetDateTime completionTime = null; - - @SerializedName("creationTime") - private OffsetDateTime creationTime = null; - - @SerializedName("id") - private String id = null; - - /** - * The status of the template - */ - public enum StatusEnum { - @SerializedName("CREATED") - CREATED("CREATED"), - - @SerializedName("UPDATED") - UPDATED("UPDATED"), - - @SerializedName("DELETED") - DELETED("DELETED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("status") - private StatusEnum status = null; - - /** - * The completion date/time of this template in ISO 8601 format - * @return completionTime - **/ - @ApiModelProperty(example = "null", value = "The completion date/time of this template in ISO 8601 format") - public OffsetDateTime getCompletionTime() { - return completionTime; - } - - /** - * The creation date/time of this template in ISO 8601 format - * @return creationTime - **/ - @ApiModelProperty(example = "null", value = "The creation date/time of this template in ISO 8601 format") - public OffsetDateTime getCreationTime() { - return creationTime; - } - - public DataSetResponse id(String id) { - this.id = id; - return this; - } - - /** - * Unique dataset id - * @return id - **/ - @ApiModelProperty(example = "null", required = true, value = "Unique dataset id") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /** - * The status of the template - * @return status - **/ - @ApiModelProperty(example = "null", required = true, value = "The status of the template") - public StatusEnum getStatus() { - return status; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DataSetResponse dataSetResponse = (DataSetResponse) o; - return Objects.equals(this.completionTime, dataSetResponse.completionTime) && - Objects.equals(this.creationTime, dataSetResponse.creationTime) && - Objects.equals(this.id, dataSetResponse.id) && - Objects.equals(this.status, dataSetResponse.status); - } - - @Override - public int hashCode() { - return Objects.hash(completionTime, creationTime, id, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DataSetResponse {\n"); - - sb.append(" completionTime: ").append(toIndentedString(completionTime)).append("\n"); - sb.append(" creationTime: ").append(toIndentedString(creationTime)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).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/java8/src/main/java/com/sphereon/sdk/template/processor/model/Error.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/Error.java deleted file mode 100644 index ab23c5d..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/Error.java +++ /dev/null @@ -1,195 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import com.sphereon.sdk.template.processor.model.Error; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - - -/** - * An error - */ -@ApiModel(description = "An error") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class Error { - @SerializedName("code") - private String code = null; - - /** - * Gets or Sets level - */ - public enum LevelEnum { - @SerializedName("INFO") - INFO("INFO"), - - @SerializedName("WARNING") - WARNING("WARNING"), - - @SerializedName("FATAL") - FATAL("FATAL"); - - private String value; - - LevelEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("level") - private LevelEnum level = null; - - @SerializedName("cause") - private Error cause = null; - - @SerializedName("message") - private String message = null; - - public Error code(String code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - **/ - @ApiModelProperty(example = "null", required = true, value = "") - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public Error level(LevelEnum level) { - this.level = level; - return this; - } - - /** - * Get level - * @return level - **/ - @ApiModelProperty(example = "null", required = true, value = "") - public LevelEnum getLevel() { - return level; - } - - public void setLevel(LevelEnum level) { - this.level = level; - } - - public Error cause(Error cause) { - this.cause = cause; - return this; - } - - /** - * Get cause - * @return cause - **/ - @ApiModelProperty(example = "null", value = "") - public Error getCause() { - return cause; - } - - public void setCause(Error cause) { - this.cause = cause; - } - - public Error message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @ApiModelProperty(example = "null", required = true, 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; - } - Error error = (Error) o; - return Objects.equals(this.code, error.code) && - Objects.equals(this.level, error.level) && - Objects.equals(this.cause, error.cause) && - Objects.equals(this.message, error.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, level, cause, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Error {\n"); - - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" level: ").append(toIndentedString(level)).append("\n"); - sb.append(" cause: ").append(toIndentedString(cause)).append("\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/java8/src/main/java/com/sphereon/sdk/template/processor/model/ErrorResponse.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/ErrorResponse.java deleted file mode 100644 index 5350d63..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/ErrorResponse.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import com.sphereon.sdk.template.processor.model.Error; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; - - -/** - * The error response - */ -@ApiModel(description = "The error response") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class ErrorResponse { - @SerializedName("errors") - private List errors = new ArrayList(); - - public ErrorResponse errors(List errors) { - this.errors = errors; - return this; - } - - public ErrorResponse addErrorsItem(Error errorsItem) { - this.errors.add(errorsItem); - return this; - } - - /** - * Get errors - * @return errors - **/ - @ApiModelProperty(example = "null", value = "") - public List getErrors() { - return errors; - } - - public void setErrors(List errors) { - this.errors = errors; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ErrorResponse errorResponse = (ErrorResponse) o; - return Objects.equals(this.errors, errorResponse.errors); - } - - @Override - public int hashCode() { - return Objects.hash(errors); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorResponse {\n"); - - sb.append(" errors: ").append(toIndentedString(errors)).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/java8/src/main/java/com/sphereon/sdk/template/processor/model/Lifecycle.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/Lifecycle.java deleted file mode 100644 index c87e74e..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/Lifecycle.java +++ /dev/null @@ -1,188 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; - - -/** - * Lifecycle settings. When no lifecycle settings are supplied, the job and files will be deleted directly after retrieval of the file - */ -@ApiModel(description = "Lifecycle settings. When no lifecycle settings are supplied, the job and files will be deleted directly after retrieval of the file") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class Lifecycle { - @SerializedName("actionTime") - private OffsetDateTime actionTime = null; - - /** - * Gets or Sets action - */ - public enum ActionEnum { - @SerializedName("DELETE") - DELETE("DELETE"); - - private String value; - - ActionEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("action") - private ActionEnum action = null; - - /** - * Gets or Sets type - */ - public enum TypeEnum { - @SerializedName("RETRIEVAL") - RETRIEVAL("RETRIEVAL"), - - @SerializedName("TIME") - TIME("TIME"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("type") - private TypeEnum type = null; - - public Lifecycle actionTime(OffsetDateTime actionTime) { - this.actionTime = actionTime; - return this; - } - - /** - * The time at which the job and files will be deleted, regardless of whether it has been retrieved or not. Maximal time is 1 day from job creation - * @return actionTime - **/ - @ApiModelProperty(example = "null", value = "The time at which the job and files will be deleted, regardless of whether it has been retrieved or not. Maximal time is 1 day from job creation") - public OffsetDateTime getActionTime() { - return actionTime; - } - - public void setActionTime(OffsetDateTime actionTime) { - this.actionTime = actionTime; - } - - public Lifecycle action(ActionEnum action) { - this.action = action; - return this; - } - - /** - * Get action - * @return action - **/ - @ApiModelProperty(example = "null", value = "") - public ActionEnum getAction() { - return action; - } - - public void setAction(ActionEnum action) { - this.action = action; - } - - public Lifecycle type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @ApiModelProperty(example = "null", value = "") - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum 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; - } - Lifecycle lifecycle = (Lifecycle) o; - return Objects.equals(this.actionTime, lifecycle.actionTime) && - Objects.equals(this.action, lifecycle.action) && - Objects.equals(this.type, lifecycle.type); - } - - @Override - public int hashCode() { - return Objects.hash(actionTime, action, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Lifecycle {\n"); - - sb.append(" actionTime: ").append(toIndentedString(actionTime)).append("\n"); - sb.append(" action: ").append(toIndentedString(action)).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/java8/src/main/java/com/sphereon/sdk/template/processor/model/MergeJob.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/MergeJob.java deleted file mode 100644 index 5863c7a..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/MergeJob.java +++ /dev/null @@ -1,343 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import com.sphereon.sdk.template.processor.model.MergeSettings; -import com.sphereon.sdk.template.processor.model.StreamLocation; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; - - -/** - * The merge job. Has access to the job merge data. - */ -@ApiModel(description = "The merge job. Has access to the job merge data.") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class MergeJob { - @SerializedName("resultFolderPath") - private String resultFolderPath = null; - - @SerializedName("completionTime") - private OffsetDateTime completionTime = null; - - @SerializedName("jobId") - private String jobId = null; - - @SerializedName("resultContainerId") - private String resultContainerId = null; - - @SerializedName("creationTime") - private OffsetDateTime creationTime = null; - - @SerializedName("dataSetId") - private String dataSetId = null; - - @SerializedName("resultStreams") - private List resultStreams = new ArrayList(); - - @SerializedName("headerDataSetIds") - private List headerDataSetIds = new ArrayList(); - - @SerializedName("mergeSettings") - private MergeSettings mergeSettings = null; - - @SerializedName("statusMessage") - private String statusMessage = null; - - /** - * The status of the job - */ - public enum StatusEnum { - @SerializedName("CREATED") - CREATED("CREATED"), - - @SerializedName("UPDATED") - UPDATED("UPDATED"), - - @SerializedName("PROCESSING") - PROCESSING("PROCESSING"), - - @SerializedName("DONE") - DONE("DONE"), - - @SerializedName("ERROR") - ERROR("ERROR"), - - @SerializedName("DELETED") - DELETED("DELETED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("status") - private StatusEnum status = null; - - public MergeJob resultFolderPath(String resultFolderPath) { - this.resultFolderPath = resultFolderPath; - return this; - } - - /** - * The target folder path of result files - * @return resultFolderPath - **/ - @ApiModelProperty(example = "null", value = "The target folder path of result files") - public String getResultFolderPath() { - return resultFolderPath; - } - - public void setResultFolderPath(String resultFolderPath) { - this.resultFolderPath = resultFolderPath; - } - - /** - * The completion date/time of this job in ISO 8601 format - * @return completionTime - **/ - @ApiModelProperty(example = "null", value = "The completion date/time of this job in ISO 8601 format") - public OffsetDateTime getCompletionTime() { - return completionTime; - } - - public MergeJob jobId(String jobId) { - this.jobId = jobId; - return this; - } - - /** - * The server generated job jobId. This jobId is checked against the jobId in the request path on every invocation - * @return jobId - **/ - @ApiModelProperty(example = "null", required = true, value = "The server generated job jobId. This jobId is checked against the jobId in the request path on every invocation") - public String getJobId() { - return jobId; - } - - public void setJobId(String jobId) { - this.jobId = jobId; - } - - public MergeJob resultContainerId(String resultContainerId) { - this.resultContainerId = resultContainerId; - return this; - } - - /** - * The target container id of result files - * @return resultContainerId - **/ - @ApiModelProperty(example = "null", value = "The target container id of result files") - public String getResultContainerId() { - return resultContainerId; - } - - public void setResultContainerId(String resultContainerId) { - this.resultContainerId = resultContainerId; - } - - /** - * The creation date/time of this job in ISO 8601 format - * @return creationTime - **/ - @ApiModelProperty(example = "null", value = "The creation date/time of this job in ISO 8601 format") - public OffsetDateTime getCreationTime() { - return creationTime; - } - - public MergeJob dataSetId(String dataSetId) { - this.dataSetId = dataSetId; - return this; - } - - /** - * Data set id - * @return dataSetId - **/ - @ApiModelProperty(example = "null", value = "Data set id") - public String getDataSetId() { - return dataSetId; - } - - public void setDataSetId(String dataSetId) { - this.dataSetId = dataSetId; - } - - public MergeJob resultStreams(List resultStreams) { - this.resultStreams = resultStreams; - return this; - } - - public MergeJob addResultStreamsItem(StreamLocation resultStreamsItem) { - this.resultStreams.add(resultStreamsItem); - return this; - } - - /** - * The storage locations of the result files. - * @return resultStreams - **/ - @ApiModelProperty(example = "null", required = true, value = "The storage locations of the result files.") - public List getResultStreams() { - return resultStreams; - } - - public void setResultStreams(List resultStreams) { - this.resultStreams = resultStreams; - } - - public MergeJob headerDataSetIds(List headerDataSetIds) { - this.headerDataSetIds = headerDataSetIds; - return this; - } - - public MergeJob addHeaderDataSetIdsItem(String headerDataSetIdsItem) { - this.headerDataSetIds.add(headerDataSetIdsItem); - return this; - } - - /** - * Header data set ids - * @return headerDataSetIds - **/ - @ApiModelProperty(example = "null", value = "Header data set ids") - public List getHeaderDataSetIds() { - return headerDataSetIds; - } - - public void setHeaderDataSetIds(List headerDataSetIds) { - this.headerDataSetIds = headerDataSetIds; - } - - public MergeJob mergeSettings(MergeSettings mergeSettings) { - this.mergeSettings = mergeSettings; - return this; - } - - /** - * Get mergeSettings - * @return mergeSettings - **/ - @ApiModelProperty(example = "null", value = "") - public MergeSettings getMergeSettings() { - return mergeSettings; - } - - public void setMergeSettings(MergeSettings mergeSettings) { - this.mergeSettings = mergeSettings; - } - - /** - * A status message, which can be informational, warning or error. A message here does not indicate an error perse - * @return statusMessage - **/ - @ApiModelProperty(example = "null", value = "A status message, which can be informational, warning or error. A message here does not indicate an error perse") - public String getStatusMessage() { - return statusMessage; - } - - /** - * The status of the job - * @return status - **/ - @ApiModelProperty(example = "null", required = true, value = "The status of the job") - public StatusEnum getStatus() { - return status; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MergeJob mergeJob = (MergeJob) o; - return Objects.equals(this.resultFolderPath, mergeJob.resultFolderPath) && - Objects.equals(this.completionTime, mergeJob.completionTime) && - Objects.equals(this.jobId, mergeJob.jobId) && - Objects.equals(this.resultContainerId, mergeJob.resultContainerId) && - Objects.equals(this.creationTime, mergeJob.creationTime) && - Objects.equals(this.dataSetId, mergeJob.dataSetId) && - Objects.equals(this.resultStreams, mergeJob.resultStreams) && - Objects.equals(this.headerDataSetIds, mergeJob.headerDataSetIds) && - Objects.equals(this.mergeSettings, mergeJob.mergeSettings) && - Objects.equals(this.statusMessage, mergeJob.statusMessage) && - Objects.equals(this.status, mergeJob.status); - } - - @Override - public int hashCode() { - return Objects.hash(resultFolderPath, completionTime, jobId, resultContainerId, creationTime, dataSetId, resultStreams, headerDataSetIds, mergeSettings, statusMessage, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MergeJob {\n"); - - sb.append(" resultFolderPath: ").append(toIndentedString(resultFolderPath)).append("\n"); - sb.append(" completionTime: ").append(toIndentedString(completionTime)).append("\n"); - sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n"); - sb.append(" resultContainerId: ").append(toIndentedString(resultContainerId)).append("\n"); - sb.append(" creationTime: ").append(toIndentedString(creationTime)).append("\n"); - sb.append(" dataSetId: ").append(toIndentedString(dataSetId)).append("\n"); - sb.append(" resultStreams: ").append(toIndentedString(resultStreams)).append("\n"); - sb.append(" headerDataSetIds: ").append(toIndentedString(headerDataSetIds)).append("\n"); - sb.append(" mergeSettings: ").append(toIndentedString(mergeSettings)).append("\n"); - sb.append(" statusMessage: ").append(toIndentedString(statusMessage)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).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/java8/src/main/java/com/sphereon/sdk/template/processor/model/MergeJobResponse.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/MergeJobResponse.java deleted file mode 100644 index 66ba379..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/MergeJobResponse.java +++ /dev/null @@ -1,186 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import com.sphereon.sdk.template.processor.model.MergeJob; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - - -/** - * The merge job response. - */ -@ApiModel(description = "The merge job response.") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class MergeJobResponse { - @SerializedName("jobId") - private String jobId = null; - - @SerializedName("job") - private MergeJob job = null; - - @SerializedName("statusMessage") - private String statusMessage = null; - - /** - * The status of the job - */ - public enum StatusEnum { - @SerializedName("CREATED") - CREATED("CREATED"), - - @SerializedName("UPDATED") - UPDATED("UPDATED"), - - @SerializedName("PROCESSING") - PROCESSING("PROCESSING"), - - @SerializedName("DONE") - DONE("DONE"), - - @SerializedName("ERROR") - ERROR("ERROR"), - - @SerializedName("DELETED") - DELETED("DELETED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("status") - private StatusEnum status = null; - - public MergeJobResponse jobId(String jobId) { - this.jobId = jobId; - return this; - } - - /** - * The server generated job jobId. This jobId is checked against the jobId in the request path on overy invocation - * @return jobId - **/ - @ApiModelProperty(example = "null", required = true, value = "The server generated job jobId. This jobId is checked against the jobId in the request path on overy invocation") - public String getJobId() { - return jobId; - } - - public void setJobId(String jobId) { - this.jobId = jobId; - } - - public MergeJobResponse job(MergeJob job) { - this.job = job; - return this; - } - - /** - * Get job - * @return job - **/ - @ApiModelProperty(example = "null", value = "") - public MergeJob getJob() { - return job; - } - - public void setJob(MergeJob job) { - this.job = job; - } - - /** - * A status message, which can be informational, warning or error. AA message here does not indicate an error perse - * @return statusMessage - **/ - @ApiModelProperty(example = "null", value = "A status message, which can be informational, warning or error. AA message here does not indicate an error perse") - public String getStatusMessage() { - return statusMessage; - } - - /** - * The status of the job - * @return status - **/ - @ApiModelProperty(example = "null", required = true, value = "The status of the job") - public StatusEnum getStatus() { - return status; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MergeJobResponse mergeJobResponse = (MergeJobResponse) o; - return Objects.equals(this.jobId, mergeJobResponse.jobId) && - Objects.equals(this.job, mergeJobResponse.job) && - Objects.equals(this.statusMessage, mergeJobResponse.statusMessage) && - Objects.equals(this.status, mergeJobResponse.status); - } - - @Override - public int hashCode() { - return Objects.hash(jobId, job, statusMessage, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MergeJobResponse {\n"); - - sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n"); - sb.append(" job: ").append(toIndentedString(job)).append("\n"); - sb.append(" statusMessage: ").append(toIndentedString(statusMessage)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).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/java8/src/main/java/com/sphereon/sdk/template/processor/model/MergeSettings.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/MergeSettings.java deleted file mode 100644 index 6fb4a54..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/MergeSettings.java +++ /dev/null @@ -1,338 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import com.sphereon.sdk.template.processor.model.Lifecycle; -import com.sphereon.sdk.template.processor.model.OutputSettings; -import com.sphereon.sdk.template.processor.model.StreamLocation; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; - - -/** - * Merge settings - */ -@ApiModel(description = "Merge settings") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class MergeSettings { - @SerializedName("lifecycle") - private Lifecycle lifecycle = null; - - /** - * Gets or Sets mergeResult - */ - public enum MergeResultEnum { - @SerializedName("SINGLE_FILE") - SINGLE_FILE("SINGLE_FILE"), - - @SerializedName("SEPARATE_FILES") - SEPARATE_FILES("SEPARATE_FILES"); - - private String value; - - MergeResultEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("mergeResult") - private MergeResultEnum mergeResult = null; - - @SerializedName("dataSetId") - private String dataSetId = null; - - /** - * Gets or Sets engine - */ - public enum EngineEnum { - @SerializedName("BASIC") - BASIC("BASIC"), - - @SerializedName("PREMIUM") - PREMIUM("PREMIUM"); - - private String value; - - EngineEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("engine") - private EngineEnum engine = null; - - @SerializedName("headerDataSetIds") - private List headerDataSetIds = new ArrayList(); - - @SerializedName("templateVersion") - private Integer templateVersion = null; - - @SerializedName("resultStreamLocation") - private StreamLocation resultStreamLocation = null; - - @SerializedName("templateId") - private String templateId = null; - - @SerializedName("outputSettings") - private OutputSettings outputSettings = null; - - public MergeSettings lifecycle(Lifecycle lifecycle) { - this.lifecycle = lifecycle; - return this; - } - - /** - * Get lifecycle - * @return lifecycle - **/ - @ApiModelProperty(example = "null", value = "") - public Lifecycle getLifecycle() { - return lifecycle; - } - - public void setLifecycle(Lifecycle lifecycle) { - this.lifecycle = lifecycle; - } - - public MergeSettings mergeResult(MergeResultEnum mergeResult) { - this.mergeResult = mergeResult; - return this; - } - - /** - * Get mergeResult - * @return mergeResult - **/ - @ApiModelProperty(example = "null", value = "") - public MergeResultEnum getMergeResult() { - return mergeResult; - } - - public void setMergeResult(MergeResultEnum mergeResult) { - this.mergeResult = mergeResult; - } - - public MergeSettings dataSetId(String dataSetId) { - this.dataSetId = dataSetId; - return this; - } - - /** - * Data set id - * @return dataSetId - **/ - @ApiModelProperty(example = "null", required = true, value = "Data set id") - public String getDataSetId() { - return dataSetId; - } - - public void setDataSetId(String dataSetId) { - this.dataSetId = dataSetId; - } - - public MergeSettings engine(EngineEnum engine) { - this.engine = engine; - return this; - } - - /** - * Get engine - * @return engine - **/ - @ApiModelProperty(example = "null", value = "") - public EngineEnum getEngine() { - return engine; - } - - public void setEngine(EngineEnum engine) { - this.engine = engine; - } - - public MergeSettings headerDataSetIds(List headerDataSetIds) { - this.headerDataSetIds = headerDataSetIds; - return this; - } - - public MergeSettings addHeaderDataSetIdsItem(String headerDataSetIdsItem) { - this.headerDataSetIds.add(headerDataSetIdsItem); - return this; - } - - /** - * optional header data set ids - * @return headerDataSetIds - **/ - @ApiModelProperty(example = "null", value = "optional header data set ids") - public List getHeaderDataSetIds() { - return headerDataSetIds; - } - - public void setHeaderDataSetIds(List headerDataSetIds) { - this.headerDataSetIds = headerDataSetIds; - } - - public MergeSettings templateVersion(Integer templateVersion) { - this.templateVersion = templateVersion; - return this; - } - - /** - * Template version - * @return templateVersion - **/ - @ApiModelProperty(example = "null", value = "Template version") - public Integer getTemplateVersion() { - return templateVersion; - } - - public void setTemplateVersion(Integer templateVersion) { - this.templateVersion = templateVersion; - } - - public MergeSettings resultStreamLocation(StreamLocation resultStreamLocation) { - this.resultStreamLocation = resultStreamLocation; - return this; - } - - /** - * The output location of the result files. - * @return resultStreamLocation - **/ - @ApiModelProperty(example = "null", required = true, value = "The output location of the result files.") - public StreamLocation getResultStreamLocation() { - return resultStreamLocation; - } - - public void setResultStreamLocation(StreamLocation resultStreamLocation) { - this.resultStreamLocation = resultStreamLocation; - } - - public MergeSettings templateId(String templateId) { - this.templateId = templateId; - return this; - } - - /** - * Template id - * @return templateId - **/ - @ApiModelProperty(example = "null", required = true, value = "Template id") - public String getTemplateId() { - return templateId; - } - - public void setTemplateId(String templateId) { - this.templateId = templateId; - } - - public MergeSettings outputSettings(OutputSettings outputSettings) { - this.outputSettings = outputSettings; - return this; - } - - /** - * Get outputSettings - * @return outputSettings - **/ - @ApiModelProperty(example = "null", required = true, value = "") - public OutputSettings getOutputSettings() { - return outputSettings; - } - - public void setOutputSettings(OutputSettings outputSettings) { - this.outputSettings = outputSettings; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MergeSettings mergeSettings = (MergeSettings) o; - return Objects.equals(this.lifecycle, mergeSettings.lifecycle) && - Objects.equals(this.mergeResult, mergeSettings.mergeResult) && - Objects.equals(this.dataSetId, mergeSettings.dataSetId) && - Objects.equals(this.engine, mergeSettings.engine) && - Objects.equals(this.headerDataSetIds, mergeSettings.headerDataSetIds) && - Objects.equals(this.templateVersion, mergeSettings.templateVersion) && - Objects.equals(this.resultStreamLocation, mergeSettings.resultStreamLocation) && - Objects.equals(this.templateId, mergeSettings.templateId) && - Objects.equals(this.outputSettings, mergeSettings.outputSettings); - } - - @Override - public int hashCode() { - return Objects.hash(lifecycle, mergeResult, dataSetId, engine, headerDataSetIds, templateVersion, resultStreamLocation, templateId, outputSettings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MergeSettings {\n"); - - sb.append(" lifecycle: ").append(toIndentedString(lifecycle)).append("\n"); - sb.append(" mergeResult: ").append(toIndentedString(mergeResult)).append("\n"); - sb.append(" dataSetId: ").append(toIndentedString(dataSetId)).append("\n"); - sb.append(" engine: ").append(toIndentedString(engine)).append("\n"); - sb.append(" headerDataSetIds: ").append(toIndentedString(headerDataSetIds)).append("\n"); - sb.append(" templateVersion: ").append(toIndentedString(templateVersion)).append("\n"); - sb.append(" resultStreamLocation: ").append(toIndentedString(resultStreamLocation)).append("\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append(" outputSettings: ").append(toIndentedString(outputSettings)).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/java8/src/main/java/com/sphereon/sdk/template/processor/model/OutputSettings.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/OutputSettings.java deleted file mode 100644 index c464f4e..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/OutputSettings.java +++ /dev/null @@ -1,212 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - - -/** - * Output settings - */ -@ApiModel(description = "Output settings") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class OutputSettings { - /** - * Gets or Sets deliveryFormat - */ - public enum DeliveryFormatEnum { - @SerializedName("PLAIN") - PLAIN("PLAIN"), - - @SerializedName("ZIP") - ZIP("ZIP"), - - @SerializedName("_7ZIP") - _7ZIP("_7ZIP"); - - private String value; - - DeliveryFormatEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("deliveryFormat") - private DeliveryFormatEnum deliveryFormat = null; - - /** - * Gets or Sets outputFormat - */ - public enum OutputFormatEnum { - @SerializedName("DOC") - DOC("DOC"), - - @SerializedName("DOCX") - DOCX("DOCX"), - - @SerializedName("RTF") - RTF("RTF"), - - @SerializedName("PDF") - PDF("PDF"), - - @SerializedName("XPS") - XPS("XPS"), - - @SerializedName("SVG") - SVG("SVG"), - - @SerializedName("HTML") - HTML("HTML"), - - @SerializedName("ODT") - ODT("ODT"), - - @SerializedName("TIFF") - TIFF("TIFF"), - - @SerializedName("PNG") - PNG("PNG"), - - @SerializedName("BMP") - BMP("BMP"), - - @SerializedName("JPEG") - JPEG("JPEG"), - - @SerializedName("TXT") - TXT("TXT"), - - @SerializedName("XML") - XML("XML"), - - @SerializedName("JSON") - JSON("JSON"), - - @SerializedName("DEFAULT") - DEFAULT("DEFAULT"); - - private String value; - - OutputFormatEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("outputFormat") - private OutputFormatEnum outputFormat = null; - - public OutputSettings deliveryFormat(DeliveryFormatEnum deliveryFormat) { - this.deliveryFormat = deliveryFormat; - return this; - } - - /** - * Get deliveryFormat - * @return deliveryFormat - **/ - @ApiModelProperty(example = "null", value = "") - public DeliveryFormatEnum getDeliveryFormat() { - return deliveryFormat; - } - - public void setDeliveryFormat(DeliveryFormatEnum deliveryFormat) { - this.deliveryFormat = deliveryFormat; - } - - public OutputSettings outputFormat(OutputFormatEnum outputFormat) { - this.outputFormat = outputFormat; - return this; - } - - /** - * Get outputFormat - * @return outputFormat - **/ - @ApiModelProperty(example = "null", value = "") - public OutputFormatEnum getOutputFormat() { - return outputFormat; - } - - public void setOutputFormat(OutputFormatEnum outputFormat) { - this.outputFormat = outputFormat; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OutputSettings outputSettings = (OutputSettings) o; - return Objects.equals(this.deliveryFormat, outputSettings.deliveryFormat) && - Objects.equals(this.outputFormat, outputSettings.outputFormat); - } - - @Override - public int hashCode() { - return Objects.hash(deliveryFormat, outputFormat); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OutputSettings {\n"); - - sb.append(" deliveryFormat: ").append(toIndentedString(deliveryFormat)).append("\n"); - sb.append(" outputFormat: ").append(toIndentedString(outputFormat)).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/java8/src/main/java/com/sphereon/sdk/template/processor/model/OwnerInfo.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/OwnerInfo.java deleted file mode 100644 index bf1c3d8..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/OwnerInfo.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - - -/** - * Owner info - */ -@ApiModel(description = "Owner info") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class OwnerInfo { - @SerializedName("phone") - private String phone = null; - - @SerializedName("companyDepartment") - private String companyDepartment = null; - - @SerializedName("name") - private String name = null; - - @SerializedName("email") - private String email = null; - - public OwnerInfo phone(String phone) { - this.phone = phone; - return this; - } - - /** - * The owner's phone number - * @return phone - **/ - @ApiModelProperty(example = "null", value = "The owner's phone number") - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public OwnerInfo companyDepartment(String companyDepartment) { - this.companyDepartment = companyDepartment; - return this; - } - - /** - * The owner's company/department - * @return companyDepartment - **/ - @ApiModelProperty(example = "null", value = "The owner's company/department") - public String getCompanyDepartment() { - return companyDepartment; - } - - public void setCompanyDepartment(String companyDepartment) { - this.companyDepartment = companyDepartment; - } - - public OwnerInfo name(String name) { - this.name = name; - return this; - } - - /** - * The owner's name - * @return name - **/ - @ApiModelProperty(example = "null", value = "The owner's name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public OwnerInfo email(String email) { - this.email = email; - return this; - } - - /** - * The owner's email address - * @return email - **/ - @ApiModelProperty(example = "null", value = "The owner's email address") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OwnerInfo ownerInfo = (OwnerInfo) o; - return Objects.equals(this.phone, ownerInfo.phone) && - Objects.equals(this.companyDepartment, ownerInfo.companyDepartment) && - Objects.equals(this.name, ownerInfo.name) && - Objects.equals(this.email, ownerInfo.email); - } - - @Override - public int hashCode() { - return Objects.hash(phone, companyDepartment, name, email); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OwnerInfo {\n"); - - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" companyDepartment: ").append(toIndentedString(companyDepartment)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).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/java8/src/main/java/com/sphereon/sdk/template/processor/model/StreamLocation.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/StreamLocation.java deleted file mode 100644 index 8c377b0..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/StreamLocation.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - - -/** - * Location record of data stream - */ -@ApiModel(description = "Location record of data stream") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class StreamLocation { - @SerializedName("folderPath") - private String folderPath = null; - - @SerializedName("originalFileName") - private String originalFileName = null; - - @SerializedName("containerId") - private String containerId = null; - - @SerializedName("fileId") - private String fileId = null; - - public StreamLocation folderPath(String folderPath) { - this.folderPath = folderPath; - return this; - } - - /** - * Get folderPath - * @return folderPath - **/ - @ApiModelProperty(example = "null", value = "") - public String getFolderPath() { - return folderPath; - } - - public void setFolderPath(String folderPath) { - this.folderPath = folderPath; - } - - public StreamLocation originalFileName(String originalFileName) { - this.originalFileName = originalFileName; - return this; - } - - /** - * Get originalFileName - * @return originalFileName - **/ - @ApiModelProperty(example = "null", value = "") - public String getOriginalFileName() { - return originalFileName; - } - - public void setOriginalFileName(String originalFileName) { - this.originalFileName = originalFileName; - } - - public StreamLocation containerId(String containerId) { - this.containerId = containerId; - return this; - } - - /** - * Get containerId - * @return containerId - **/ - @ApiModelProperty(example = "null", value = "") - public String getContainerId() { - return containerId; - } - - public void setContainerId(String containerId) { - this.containerId = containerId; - } - - public StreamLocation fileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get fileId - * @return fileId - **/ - @ApiModelProperty(example = "null", value = "") - public String getFileId() { - return fileId; - } - - public void setFileId(String fileId) { - this.fileId = fileId; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StreamLocation streamLocation = (StreamLocation) o; - return Objects.equals(this.folderPath, streamLocation.folderPath) && - Objects.equals(this.originalFileName, streamLocation.originalFileName) && - Objects.equals(this.containerId, streamLocation.containerId) && - Objects.equals(this.fileId, streamLocation.fileId); - } - - @Override - public int hashCode() { - return Objects.hash(folderPath, originalFileName, containerId, fileId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StreamLocation {\n"); - - sb.append(" folderPath: ").append(toIndentedString(folderPath)).append("\n"); - sb.append(" originalFileName: ").append(toIndentedString(originalFileName)).append("\n"); - sb.append(" containerId: ").append(toIndentedString(containerId)).append("\n"); - sb.append(" fileId: ").append(toIndentedString(fileId)).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/java8/src/main/java/com/sphereon/sdk/template/processor/model/TemplateContext.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/TemplateContext.java deleted file mode 100644 index 88450bd..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/TemplateContext.java +++ /dev/null @@ -1,246 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import com.sphereon.sdk.template.processor.model.OwnerInfo; -import com.sphereon.sdk.template.processor.model.StreamLocation; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -/** - * TemplateContext - */ -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class TemplateContext { - /** - * Gets or Sets templateType - */ - public enum TemplateTypeEnum { - @SerializedName("OFFICE") - OFFICE("OFFICE"), - - @SerializedName("FREEMARKER") - FREEMARKER("FREEMARKER"); - - private String value; - - TemplateTypeEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("templateType") - private TemplateTypeEnum templateType = null; - - @SerializedName("templateFileLocations") - private Map templateFileLocations = new HashMap(); - - @SerializedName("description") - private String description = null; - - @SerializedName("ownerInfo") - private OwnerInfo ownerInfo = null; - - @SerializedName("id") - private String id = null; - - @SerializedName("templateId") - private String templateId = null; - - public TemplateContext templateType(TemplateTypeEnum templateType) { - this.templateType = templateType; - return this; - } - - /** - * Get templateType - * @return templateType - **/ - @ApiModelProperty(example = "null", required = true, value = "") - public TemplateTypeEnum getTemplateType() { - return templateType; - } - - public void setTemplateType(TemplateTypeEnum templateType) { - this.templateType = templateType; - } - - public TemplateContext templateFileLocations(Map templateFileLocations) { - this.templateFileLocations = templateFileLocations; - return this; - } - - public TemplateContext putTemplateFileLocationsItem(String key, StreamLocation templateFileLocationsItem) { - this.templateFileLocations.put(key, templateFileLocationsItem); - return this; - } - - /** - * The template files (versioned) - * @return templateFileLocations - **/ - @ApiModelProperty(example = "null", value = "The template files (versioned)") - public Map getTemplateFileLocations() { - return templateFileLocations; - } - - public void setTemplateFileLocations(Map templateFileLocations) { - this.templateFileLocations = templateFileLocations; - } - - public TemplateContext description(String description) { - this.description = description; - return this; - } - - /** - * The template description - * @return description - **/ - @ApiModelProperty(example = "null", value = "The template description") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public TemplateContext ownerInfo(OwnerInfo ownerInfo) { - this.ownerInfo = ownerInfo; - return this; - } - - /** - * Get ownerInfo - * @return ownerInfo - **/ - @ApiModelProperty(example = "null", value = "") - public OwnerInfo getOwnerInfo() { - return ownerInfo; - } - - public void setOwnerInfo(OwnerInfo ownerInfo) { - this.ownerInfo = ownerInfo; - } - - public TemplateContext id(String id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @ApiModelProperty(example = "null", value = "") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public TemplateContext templateId(String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The template context id - * @return templateId - **/ - @ApiModelProperty(example = "null", value = "The template context id") - public String getTemplateId() { - return templateId; - } - - public void setTemplateId(String templateId) { - this.templateId = templateId; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateContext templateContext = (TemplateContext) o; - return Objects.equals(this.templateType, templateContext.templateType) && - Objects.equals(this.templateFileLocations, templateContext.templateFileLocations) && - Objects.equals(this.description, templateContext.description) && - Objects.equals(this.ownerInfo, templateContext.ownerInfo) && - Objects.equals(this.id, templateContext.id) && - Objects.equals(this.templateId, templateContext.templateId); - } - - @Override - public int hashCode() { - return Objects.hash(templateType, templateFileLocations, description, ownerInfo, id, templateId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateContext {\n"); - - sb.append(" templateType: ").append(toIndentedString(templateType)).append("\n"); - sb.append(" templateFileLocations: ").append(toIndentedString(templateFileLocations)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" ownerInfo: ").append(toIndentedString(ownerInfo)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).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/java8/src/main/java/com/sphereon/sdk/template/processor/model/TemplateContextRequest.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/TemplateContextRequest.java deleted file mode 100644 index c03cef2..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/TemplateContextRequest.java +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import com.sphereon.sdk.template.processor.model.OwnerInfo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - - -/** - * The merge template request. - */ -@ApiModel(description = "The merge template request.") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class TemplateContextRequest { - /** - * Gets or Sets templateType - */ - public enum TemplateTypeEnum { - @SerializedName("OFFICE") - OFFICE("OFFICE"), - - @SerializedName("FREEMARKER") - FREEMARKER("FREEMARKER"); - - private String value; - - TemplateTypeEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("templateType") - private TemplateTypeEnum templateType = null; - - @SerializedName("description") - private String description = null; - - @SerializedName("ownerInfo") - private OwnerInfo ownerInfo = null; - - @SerializedName("templateId") - private String templateId = null; - - public TemplateContextRequest templateType(TemplateTypeEnum templateType) { - this.templateType = templateType; - return this; - } - - /** - * Get templateType - * @return templateType - **/ - @ApiModelProperty(example = "null", required = true, value = "") - public TemplateTypeEnum getTemplateType() { - return templateType; - } - - public void setTemplateType(TemplateTypeEnum templateType) { - this.templateType = templateType; - } - - public TemplateContextRequest description(String description) { - this.description = description; - return this; - } - - /** - * Get description - * @return description - **/ - @ApiModelProperty(example = "null", value = "") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public TemplateContextRequest ownerInfo(OwnerInfo ownerInfo) { - this.ownerInfo = ownerInfo; - return this; - } - - /** - * Get ownerInfo - * @return ownerInfo - **/ - @ApiModelProperty(example = "null", value = "") - public OwnerInfo getOwnerInfo() { - return ownerInfo; - } - - public void setOwnerInfo(OwnerInfo ownerInfo) { - this.ownerInfo = ownerInfo; - } - - public TemplateContextRequest templateId(String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The template context id - * @return templateId - **/ - @ApiModelProperty(example = "null", value = "The template context id") - public String getTemplateId() { - return templateId; - } - - public void setTemplateId(String templateId) { - this.templateId = templateId; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateContextRequest templateContextRequest = (TemplateContextRequest) o; - return Objects.equals(this.templateType, templateContextRequest.templateType) && - Objects.equals(this.description, templateContextRequest.description) && - Objects.equals(this.ownerInfo, templateContextRequest.ownerInfo) && - Objects.equals(this.templateId, templateContextRequest.templateId); - } - - @Override - public int hashCode() { - return Objects.hash(templateType, description, ownerInfo, templateId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateContextRequest {\n"); - - sb.append(" templateType: ").append(toIndentedString(templateType)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" ownerInfo: ").append(toIndentedString(ownerInfo)).append("\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).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/java8/src/main/java/com/sphereon/sdk/template/processor/model/TemplateContextResponse.java b/java8/src/main/java/com/sphereon/sdk/template/processor/model/TemplateContextResponse.java deleted file mode 100644 index 8b20425..0000000 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/model/TemplateContextResponse.java +++ /dev/null @@ -1,181 +0,0 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; -import com.sphereon.sdk.template.processor.model.TemplateContext; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; - - -/** - * The merge template response. - */ -@ApiModel(description = "The merge template response.") -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-07T23:35:11.957+02:00") -public class TemplateContextResponse { - @SerializedName("creationTime") - private OffsetDateTime creationTime = null; - - @SerializedName("context") - private TemplateContext context = null; - - @SerializedName("id") - private String id = null; - - /** - * The status of the template - */ - public enum StatusEnum { - @SerializedName("CREATED") - CREATED("CREATED"), - - @SerializedName("UPDATED") - UPDATED("UPDATED"), - - @SerializedName("DELETED") - DELETED("DELETED"), - - @SerializedName("PROCESSING") - PROCESSING("PROCESSING"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - @SerializedName("status") - private StatusEnum status = null; - - /** - * The creation date/time of this response in ISO 8601 format - * @return creationTime - **/ - @ApiModelProperty(example = "null", value = "The creation date/time of this response in ISO 8601 format") - public OffsetDateTime getCreationTime() { - return creationTime; - } - - public TemplateContextResponse context(TemplateContext context) { - this.context = context; - return this; - } - - /** - * Get context - * @return context - **/ - @ApiModelProperty(example = "null", value = "") - public TemplateContext getContext() { - return context; - } - - public void setContext(TemplateContext context) { - this.context = context; - } - - public TemplateContextResponse id(String id) { - this.id = id; - return this; - } - - /** - * Unique template context id - * @return id - **/ - @ApiModelProperty(example = "null", required = true, value = "Unique template context id") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /** - * The status of the template - * @return status - **/ - @ApiModelProperty(example = "null", required = true, value = "The status of the template") - public StatusEnum getStatus() { - return status; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateContextResponse templateContextResponse = (TemplateContextResponse) o; - return Objects.equals(this.creationTime, templateContextResponse.creationTime) && - Objects.equals(this.context, templateContextResponse.context) && - Objects.equals(this.id, templateContextResponse.id) && - Objects.equals(this.status, templateContextResponse.status); - } - - @Override - public int hashCode() { - return Objects.hash(creationTime, context, id, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateContextResponse {\n"); - - sb.append(" creationTime: ").append(toIndentedString(creationTime)).append("\n"); - sb.append(" context: ").append(toIndentedString(context)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).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/java8/src/test/java/com/sphereon/sdk/template/processor/api/IntegrationTest.java b/java8/src/test/java/com/sphereon/sdk/template/processor/api/IntegrationTest.java deleted file mode 100644 index 2bb2004..0000000 --- a/java8/src/test/java/com/sphereon/sdk/template/processor/api/IntegrationTest.java +++ /dev/null @@ -1,515 +0,0 @@ -/** - * OfficeTextMerge - * The Office Text API can generate office documents from a template and a JSON data file< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - *

- * OpenAPI spec version: 0.1.0 - * Contact: dev@sphereon.com - *

- * 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. - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.api; - -import com.sphereon.sdk.template.processor.handler.ApiException; -import com.sphereon.sdk.template.processor.model.*; -import org.apache.commons.io.FileUtils; -import org.apache.tika.io.TikaInputStream; -import org.apache.tika.metadata.Metadata; -import org.apache.tika.mime.MediaType; -import org.apache.tika.mime.MimeTypes; -import org.apache.tika.parser.AutoDetectParser; -import org.apache.tika.parser.ParseContext; -import org.apache.tika.sax.BodyContentHandler; -import org.junit.Assert; -import org.junit.Before; -import org.junit.FixMethodOrder; -import org.junit.Test; -import org.junit.runners.MethodSorters; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * API tests for AllApi - */ -@FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class IntegrationTest { - - protected static final String MS_WORD_DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; - private static String headerId; - private static String dataSetId; - private static String templateId; - private static File templateFile; - private static String jobId; - private final AllApi api = new AllApi(); - - @Before - public void initApi() { - api.getApiClient().setAccessToken("0dbd17f1-c108-350e-807e-42d13e543b32"); - } - - /** - * Store dataset - *

- * Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job. - * - * @throws ApiException if the Api call fails - */ - @Test - public void _01_createDataSetTest() throws ApiException { - - String header1PayLoad = getPayLoad("header1.json"); - DataSetResponse response = api.createDataSet(header1PayLoad); - Assert.assertNotNull(response); - Assert.assertEquals(DataSetResponse.StatusEnum.CREATED, response.getStatus()); - this.headerId = response.getId(); - Assert.assertNotNull(headerId); - - String dataSet1PayLoad = getPayLoad("dataset1.json"); - response = api.createDataSet(dataSet1PayLoad); - Assert.assertEquals(DataSetResponse.StatusEnum.CREATED, response.getStatus()); - this.dataSetId = response.getId(); - Assert.assertNotNull(dataSetId); - } - - - /** - * Create template context - *

- * Create a unique template context for your environment - * - * @throws ApiException if the Api call fails - */ - @Test - public void _02_createTemplateContextTest() throws ApiException { - this.templateId = "templateId"; - TemplateContextResponse response = null; - try { - response = api.deleteTemplateContext(templateId); - Assert.assertNotNull(response); - } catch (Exception e) { - - } - - - OwnerInfo initialOwnerInfo = new OwnerInfo(); - initialOwnerInfo.setCompanyDepartment("companyDepartment"); - initialOwnerInfo.setEmail("email"); - initialOwnerInfo.setName("name"); - initialOwnerInfo.setPhone("phone"); - - String description = "description"; - - TemplateContextRequest templateContextRequest = new TemplateContextRequest(); - templateContextRequest.setDescription(description); - templateContextRequest.setOwnerInfo(initialOwnerInfo); - templateContextRequest.setTemplateId(templateId); - templateContextRequest.setTemplateType(TemplateContextRequest.TemplateTypeEnum.OFFICE); - response = api.createTemplateContext(templateContextRequest); - Assert.assertNotNull(response); - Assert.assertEquals(TemplateContextResponse.StatusEnum.CREATED, response.getStatus()); - TemplateContext templateContext = response.getContext(); - Assert.assertNotNull(templateContext); - OwnerInfo ownerInfo = templateContext.getOwnerInfo(); - Assert.assertNotNull(ownerInfo); - Assert.assertEquals(initialOwnerInfo.getCompanyDepartment(), ownerInfo.getCompanyDepartment()); - Assert.assertEquals(initialOwnerInfo.getEmail(), ownerInfo.getEmail()); - Assert.assertEquals(initialOwnerInfo.getName(), ownerInfo.getName()); - Assert.assertEquals(initialOwnerInfo.getPhone(), ownerInfo.getPhone()); - - Assert.assertEquals(description, templateContext.getDescription()); - Assert.assertEquals(templateId, templateContext.getTemplateId()); - Map templateFiles = templateContext.getTemplateFileLocations(); - Assert.assertTrue(templateFiles.isEmpty()); - } - - /** - * Update template context - *

- * Update an existing template context for your environment - * - * @throws ApiException if the Api call fails - */ - @Test - public void _03_updateTemplateContextTest() throws ApiException { - String changedDescription = "changedDescription"; - OwnerInfo changedOwnerInfo = new OwnerInfo(); - changedOwnerInfo.setCompanyDepartment("changedCompanyDepartment"); - changedOwnerInfo.setEmail("changedEmail"); - changedOwnerInfo.setName("changedName"); - changedOwnerInfo.setPhone("changedPhone"); - - TemplateContextRequest templateContextRequest = new TemplateContextRequest(); - templateContextRequest.setDescription(changedDescription); - templateContextRequest.setOwnerInfo(changedOwnerInfo); - templateContextRequest.setTemplateId(templateId); - TemplateContextResponse response = api.updateTemplateContext(templateContextRequest); - - Assert.assertNotNull(response); - Assert.assertEquals(TemplateContextResponse.StatusEnum.UPDATED, response.getStatus()); - TemplateContext templateContext = response.getContext(); - Assert.assertNotNull(templateContext); - OwnerInfo ownerInfo = templateContext.getOwnerInfo(); - Assert.assertNotNull(ownerInfo); - Assert.assertEquals(changedOwnerInfo.getCompanyDepartment(), ownerInfo.getCompanyDepartment()); - Assert.assertEquals(changedOwnerInfo.getEmail(), ownerInfo.getEmail()); - Assert.assertEquals(changedOwnerInfo.getName(), ownerInfo.getName()); - Assert.assertEquals(changedOwnerInfo.getPhone(), ownerInfo.getPhone()); - - Assert.assertEquals(changedDescription, templateContext.getDescription()); - Assert.assertEquals(templateId, templateContext.getTemplateId()); - Map templateFiles = templateContext.getTemplateFileLocations(); - Assert.assertTrue(templateFiles.isEmpty()); - } - - /** - * Upload template file - *

- * Upload the Office template file - * - * @throws ApiException if the Api call fails - */ - @Test - public void _04_uploadTemplateFileTest() throws ApiException { - templateFile = getFile("Template with header fields.dotx"); - TemplateContextResponse response = api.uploadTemplateFile(templateId, templateFile); - TemplateContext templateContext = response.getContext(); - Assert.assertNotNull(templateContext); - } - - /** - * Get template context - *

- * Get an existing template context - * - * @throws ApiException if the Api call fails - */ - @Test - public void _05_getTemplateContextTest() throws ApiException { - String changedDescription = "changedDescription"; - OwnerInfo changedOwnerInfo = new OwnerInfo(); - changedOwnerInfo.setCompanyDepartment("changedCompanyDepartment"); - changedOwnerInfo.setEmail("changedEmail"); - changedOwnerInfo.setName("changedName"); - changedOwnerInfo.setPhone("changedPhone"); - - - TemplateContextResponse response = api.getTemplateContext(templateId); - Assert.assertNotNull(response); - Assert.assertEquals(TemplateContextResponse.StatusEnum.PROCESSING, response.getStatus()); - TemplateContext templateContext = response.getContext(); - Assert.assertNotNull(templateContext); - OwnerInfo ownerInfo = templateContext.getOwnerInfo(); - Assert.assertNotNull(ownerInfo); - Assert.assertEquals(changedOwnerInfo.getCompanyDepartment(), ownerInfo.getCompanyDepartment()); - Assert.assertEquals(changedOwnerInfo.getEmail(), ownerInfo.getEmail()); - Assert.assertEquals(changedOwnerInfo.getName(), ownerInfo.getName()); - Assert.assertEquals(changedOwnerInfo.getPhone(), ownerInfo.getPhone()); - - Assert.assertEquals(changedDescription, templateContext.getDescription()); - Assert.assertEquals(templateId, templateContext.getTemplateId()); - Map templateFiles = templateContext.getTemplateFileLocations(); - Assert.assertEquals(1, templateFiles.size()); - Set keys = templateFiles.keySet(); - String key = keys.iterator().next(); - String expectedFileName = templateFile.getName(); - Assert.assertTrue(templateFiles.get(key).getOriginalFileName().contains(expectedFileName)); - } - - @Test - public void _06_deleteAllJobsTest() throws ApiException { - List statusses = new ArrayList<>(); - - for (MergeJobResponse.StatusEnum statusEnum : MergeJobResponse.StatusEnum.values()) { - statusses.add(statusEnum.name()); - } - - List response = api.getJobs(statusses); - for (MergeJobResponse mergeJobResponse : response) { - api.deleteJob(mergeJobResponse.getJobId()); - } - } - - /** - * Submit merge job for processing - *

- * Submit merge job run. - * - * @throws ApiException if the Api call fails - */ - @Test - public void _07_submitJobTest() throws ApiException { - MergeSettings providedMergeSettings = new MergeSettings(); - providedMergeSettings.setMergeResult(MergeSettings.MergeResultEnum.SINGLE_FILE); - providedMergeSettings.setTemplateId(templateId); - providedMergeSettings.setDataSetId(dataSetId); - providedMergeSettings.setEngine(MergeSettings.EngineEnum.PREMIUM); - Lifecycle lifecycle = new Lifecycle(); - lifecycle.setType(Lifecycle.TypeEnum.TIME); - providedMergeSettings.setLifecycle(lifecycle); - providedMergeSettings.getHeaderDataSetIds().add(headerId); - OutputSettings outputSettings = new OutputSettings(); - outputSettings.setOutputFormat(OutputSettings.OutputFormatEnum.DOCX); - outputSettings.setDeliveryFormat(OutputSettings.DeliveryFormatEnum.PLAIN); - providedMergeSettings.setOutputSettings(outputSettings); - MergeJobResponse response = api.submitJob(providedMergeSettings); - Assert.assertNotNull(response); - Assert.assertEquals(MergeJobResponse.StatusEnum.CREATED, response.getStatus()); - MergeJob job = response.getJob(); - Assert.assertNotNull(job); - - Assert.assertEquals(MergeJob.StatusEnum.CREATED, job.getStatus()); - - this.jobId = job.getJobId(); - Assert.assertNotNull(this.jobId); - MergeSettings mergeSettings = job.getMergeSettings(); - Assert.assertNotNull(mergeSettings); - - Assert.assertEquals(providedMergeSettings.getMergeResult(), mergeSettings.getMergeResult()); - Assert.assertEquals(providedMergeSettings.getTemplateId(), mergeSettings.getTemplateId()); - Assert.assertEquals(providedMergeSettings.getDataSetId(), mergeSettings.getDataSetId()); - Assert.assertEquals(providedMergeSettings.getEngine(), mergeSettings.getEngine()); - Assert.assertEquals(providedMergeSettings.getLifecycle().getType(), mergeSettings.getLifecycle().getType()); - Assert.assertEquals(providedMergeSettings.getHeaderDataSetIds().size(), mergeSettings.getHeaderDataSetIds().size()); - } - - - /** - * Job definition and state - *

- * Get the merge job definition and current state. Please not that you can differentiate based on http response status - * - * @throws ApiException if the Api call fails - */ - @Test - public void _08_getJobTest() throws ApiException { - MergeJobResponse response = api.getJob(jobId); - Assert.assertNotNull(response); - Assert.assertEquals(jobId, response.getJobId()); - } - - /** - * Get all jobs - *

- * Get all office text job definitions and their current state. - * - * @throws ApiException if the Api call fails - */ - @Test - public void _09_getJobsTest() throws ApiException { - List statusses = new ArrayList<>(); - - for (MergeJobResponse.StatusEnum statusEnum : MergeJobResponse.StatusEnum.values()) { - statusses.add(statusEnum.name()); - } - - List responses = api.getJobs(statusses); - Assert.assertNotNull(responses); - Assert.assertTrue(responses.size() > 0); - MergeJobResponse mergeJobResponse = null; - for (MergeJobResponse response : responses) { - if (jobId.equals(response.getJobId())) { - mergeJobResponse = response; - } - } - Assert.assertNotNull(mergeJobResponse); - } - - /** - * Get the result file - *

- * Get a merge result document as a binary stream. - * - * @throws ApiException if the Api call fails - */ - @Test - public void _10_getResultStreamByIdTest() throws ApiException, InterruptedException { - MergeJobResponse mergeJobResponse; - int countDown = 20; - do { - mergeJobResponse = api.getJob(jobId); - Thread.sleep(1000); - countDown--; - } - while (mergeJobResponse != null && !MergeJobResponse.StatusEnum.DONE.equals(mergeJobResponse.getStatus()) && countDown > 0); - - - MergeJob job = mergeJobResponse.getJob(); - Assert.assertNotNull(job); - List resultFiles = job.getResultStreams(); - Assert.assertNotNull(resultFiles); - Assert.assertEquals(1, resultFiles.size()); - StreamLocation streamLocation = resultFiles.get(0); - String streamId = streamLocation.getFileId(); - OutputSettings outputSettings = new OutputSettings(); - outputSettings.setDeliveryFormat(OutputSettings.DeliveryFormatEnum.PLAIN); - outputSettings.setOutputFormat(OutputSettings.OutputFormatEnum.DOCX); - byte[] data = api.getResultStreamById(jobId, streamId, outputSettings); - - assertValidMediaType(data, MediaType.APPLICATION_ZIP.toString()); // DOCX document is actually a zip file - } - - /** - * Get the result file - *

- * Get all documents inside a compressed container as a binary stream. - * - * @throws ApiException if the Api call fails - */ - @Test - public void _11_getResultStreamsAsContainerTest() throws ApiException, InterruptedException { - MergeJobResponse mergeJobResponse; - int countDown = 20; - do { - mergeJobResponse = api.getJob(jobId); - Thread.sleep(1000); - countDown--; - } - while (mergeJobResponse != null && !MergeJobResponse.StatusEnum.DONE.equals(mergeJobResponse.getStatus()) && countDown > 0); - - - MergeJob job = mergeJobResponse.getJob(); - Assert.assertNotNull(job); - OutputSettings outputSettings = new OutputSettings(); - outputSettings.setDeliveryFormat(OutputSettings.DeliveryFormatEnum.ZIP); - outputSettings.setOutputFormat(OutputSettings.OutputFormatEnum.DOCX); - - byte[] data = api.getResultStreamsAsContainer(jobId, outputSettings); - assertValidMediaType(data, MediaType.APPLICATION_ZIP.toString()); - } - - - /** - * Delete a stored data set - *

- * Delete a stored data set - * - * @throws ApiException if the Api call fails - */ - @Test - public void _12_deleteDataSetTest() throws ApiException { - DataSetResponse response = api.deleteDataSet(dataSetId); - Assert.assertNotNull(response); - Assert.assertEquals(DataSetResponse.StatusEnum.DELETED, response.getStatus()); - Assert.assertEquals(dataSetId, response.getId()); - - response = api.deleteDataSet(headerId); - Assert.assertNotNull(response); - Assert.assertEquals(DataSetResponse.StatusEnum.DELETED, response.getStatus()); - Assert.assertEquals(headerId, response.getId()); - - - } - - - /** - * Delete template context - *

- * Delete a template context with all history - * - * @throws ApiException if the Api call fails - */ - @Test - public void _13_deleteTemplateContextTest() throws ApiException { - TemplateContextResponse response = api.deleteTemplateContext(templateId); - Assert.assertNotNull(response); - Assert.assertEquals(TemplateContextResponse.StatusEnum.DELETED, response.getStatus()); - Assert.assertEquals(templateId, response.getContext().getTemplateId()); - } - - /** - * Delete a job manually - *

- * Delete the merge job and all related files - * - * @throws ApiException if the Api call fails - */ - @Test - public void _14_deleteJobTest() throws ApiException { - MergeJobResponse response = api.deleteJob(jobId); - Assert.assertNotNull(response); - Assert.assertEquals(MergeJobResponse.StatusEnum.DELETED, response.getStatus()); - Assert.assertEquals(jobId, response.getJobId()); - } - - /** - * Get all jobs - *

- * Get all office text job definitions and their current state. - * - * @throws ApiException if the Api call fails - */ - @Test - public void _15_getJobsTest() throws ApiException { - List statusses = new ArrayList<>(); - statusses.add("DONE"); - List response = api.getJobs(statusses); - Assert.assertNotNull(response); - Assert.assertEquals(0, response.size()); - } - - private String getPayLoad(String fileName) { - try { - File file = getFile(fileName); - return FileUtils.readFileToString(file); - } catch (IOException e) { - Assert.fail(e.getMessage()); - } - return ""; - } - - private File getFile(String fileName) { - try { - URL resource = getClass().getClassLoader().getResource(fileName); - File file = new File(resource.toURI()); - Assert.assertTrue(file.exists()); - return file; - } catch (URISyntaxException e) { - Assert.fail(e.getMessage()); - } - return null; - } - - private void assertValidMediaType(byte[] data, String expectedMediaType) { - Assert.assertNotNull(data); - - AutoDetectParser autoDetectParser = new AutoDetectParser(); - - InputStream is = TikaInputStream.get(new ByteArrayInputStream(data)); - Metadata metadata = new Metadata(); - BodyContentHandler bodyContentHandler = new BodyContentHandler(-1); - try { - autoDetectParser.parse(is, bodyContentHandler, metadata, new ParseContext()); - MimeTypes mimeTypes = new MimeTypes(); - MediaType mediaType = mimeTypes.detect(is, metadata); - is.close(); - Assert.assertEquals(expectedMediaType, mediaType.toString()); - } catch (Exception e) { - Assert.fail(e.getMessage()); - } - } - -} diff --git a/java8/src/test/resources/Template with header fields.dotx b/java8/src/test/resources/Template with header fields.dotx deleted file mode 100644 index dd8fdf6..0000000 Binary files a/java8/src/test/resources/Template with header fields.dotx and /dev/null differ diff --git a/java8/src/test/resources/dataset1.json b/java8/src/test/resources/dataset1.json deleted file mode 100644 index a968083..0000000 --- a/java8/src/test/resources/dataset1.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "Field1": "Field1Row1", - "Field2": "Field2Row1" - }, - { - "Field1": "Field1Row2", - "Field2": "Field2Row2" - } -] \ No newline at end of file diff --git a/java8/src/test/resources/header1.json b/java8/src/test/resources/header1.json deleted file mode 100644 index e8b5c58..0000000 --- a/java8/src/test/resources/header1.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "Header1": "Header1Value", - "Header2": "Header2Value" - } -] \ No newline at end of file diff --git a/javascript/.swagger-codegen-ignore b/javascript/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/javascript/.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/javascript/.swagger-codegen/VERSION b/javascript/.swagger-codegen/VERSION new file mode 100644 index 0000000..a625450 --- /dev/null +++ b/javascript/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/javascript/.travis.yml b/javascript/.travis.yml new file mode 100644 index 0000000..e49f469 --- /dev/null +++ b/javascript/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "6" + - "6.1" + - "5" + - "5.11" + diff --git a/javascript/README.md b/javascript/README.md new file mode 100644 index 0000000..990ac3e --- /dev/null +++ b/javascript/README.md @@ -0,0 +1,184 @@ +# template_processor + +TemplateProcessor - JavaScript client for template_processor +The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store +This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 0.1 +- Package version: 0.1 +- Build package: io.swagger.codegen.languages.JavascriptClientCodegen +For more information, please visit [https://sphereon.com](https://sphereon.com) + +## Installation + +### For [Node.js](https://nodejs.org/) + +#### npm + +To publish the library as a [npm](https://www.npmjs.com/), +please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages). + +Then install it via: + +```shell +npm install template_processor --save +``` + +##### Local development + +To use the library locally without publishing to a remote npm registry, first install the dependencies by changing +into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run: + +```shell +npm install +``` + +Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`: + +```shell +npm link +``` + +Finally, switch to the directory you want to use your template_processor from, and run: + +```shell +npm link /path/to/ +``` + +You should now be able to `require('template_processor')` in javascript files from the directory you ran the last +command above from. + +#### git +# +If the library is hosted at a git repository, e.g. +https://github.com/GIT_USER_ID/GIT_REPO_ID +then install it via: + +```shell + npm install GIT_USER_ID/GIT_REPO_ID --save +``` + +### For browser + +The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following +the above steps with Node.js and installing browserify with `npm install -g browserify`, +perform the following (assuming *main.js* is your entry file, that's to say your javascript file where you actually +use this library): + +```shell +browserify main.js > bundle.js +``` + +Then include *bundle.js* in the HTML pages. + +### Webpack Configuration + +Using Webpack you may encounter the following error: "Module not found: Error: +Cannot resolve module", most certainly you should disable AMD loader. Add/merge +the following section to your webpack config: + +```javascript +module: { + rules: [ + { + parser: { + amd: false + } + } + ] +} +``` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following JS code: + +```javascript +var TemplateProcessor = require('template_processor'); + +var defaultClient = TemplateProcessor.ApiClient.instance; + +// Configure OAuth2 access token for authorization: oauth2schema +var oauth2schema = defaultClient.authentications['oauth2schema']; +oauth2schema.accessToken = "YOUR ACCESS TOKEN" + +var api = new TemplateProcessor.AllApi() + +var payload = "payload_example"; // {String} The dates for the merge [ { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", }, { \"Field1\": \"Field1 value\", \"Field2\": \"Field2 value\", } ] + + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +api.createDataSet(payload, callback); + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://gw.api.cloud.sphereon.com/template/processor/0.1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*TemplateProcessor.AllApi* | [**createDataSet**](docs/AllApi.md#createDataSet) | **POST** /datasets | Store dataset +*TemplateProcessor.AllApi* | [**createTemplateContext**](docs/AllApi.md#createTemplateContext) | **POST** /templates | Create template context +*TemplateProcessor.AllApi* | [**deleteDataSet**](docs/AllApi.md#deleteDataSet) | **DELETE** /datasets/{dataSetId} | Delete a stored data set +*TemplateProcessor.AllApi* | [**deleteJob**](docs/AllApi.md#deleteJob) | **DELETE** /jobs/{jobId} | Delete a job manually +*TemplateProcessor.AllApi* | [**deleteTemplateContext**](docs/AllApi.md#deleteTemplateContext) | **DELETE** /templates/{templateId} | Delete template context +*TemplateProcessor.AllApi* | [**getJob**](docs/AllApi.md#getJob) | **GET** /jobs/{jobId} | Job definition and state +*TemplateProcessor.AllApi* | [**getJobs**](docs/AllApi.md#getJobs) | **GET** /jobs | Get all jobs +*TemplateProcessor.AllApi* | [**getResultStream**](docs/AllApi.md#getResultStream) | **PUT** /jobs/{jobId}/result/stream | Get the result file +*TemplateProcessor.AllApi* | [**getResultStreamsAsContainer**](docs/AllApi.md#getResultStreamsAsContainer) | **PUT** /jobs/{jobId}/result/container | Get the result file +*TemplateProcessor.AllApi* | [**getTemplateContext**](docs/AllApi.md#getTemplateContext) | **GET** /templates/{templateId} | Get template context +*TemplateProcessor.AllApi* | [**submitJob**](docs/AllApi.md#submitJob) | **PUT** /jobs | Submit merge job for processing +*TemplateProcessor.AllApi* | [**updateTemplateContext**](docs/AllApi.md#updateTemplateContext) | **PUT** /templates | Update template context +*TemplateProcessor.AllApi* | [**uploadTemplateFile**](docs/AllApi.md#uploadTemplateFile) | **POST** /templates/{templateId} | Upload template file +*TemplateProcessor.DataSetApi* | [**createDataSet**](docs/DataSetApi.md#createDataSet) | **POST** /datasets | Store dataset +*TemplateProcessor.DataSetApi* | [**deleteDataSet**](docs/DataSetApi.md#deleteDataSet) | **DELETE** /datasets/{dataSetId} | Delete a stored data set +*TemplateProcessor.JobApi* | [**getJob**](docs/JobApi.md#getJob) | **GET** /jobs/{jobId} | Job definition and state +*TemplateProcessor.JobApi* | [**getJobs**](docs/JobApi.md#getJobs) | **GET** /jobs | Get all jobs +*TemplateProcessor.JobApi* | [**getResultStream**](docs/JobApi.md#getResultStream) | **PUT** /jobs/{jobId}/result/stream | Get the result file +*TemplateProcessor.JobApi* | [**getResultStreamsAsContainer**](docs/JobApi.md#getResultStreamsAsContainer) | **PUT** /jobs/{jobId}/result/container | Get the result file +*TemplateProcessor.JobApi* | [**submitJob**](docs/JobApi.md#submitJob) | **PUT** /jobs | Submit merge job for processing +*TemplateProcessor.TemplateApi* | [**createTemplateContext**](docs/TemplateApi.md#createTemplateContext) | **POST** /templates | Create template context +*TemplateProcessor.TemplateApi* | [**deleteTemplateContext**](docs/TemplateApi.md#deleteTemplateContext) | **DELETE** /templates/{templateId} | Delete template context +*TemplateProcessor.TemplateApi* | [**getTemplateContext**](docs/TemplateApi.md#getTemplateContext) | **GET** /templates/{templateId} | Get template context +*TemplateProcessor.TemplateApi* | [**updateTemplateContext**](docs/TemplateApi.md#updateTemplateContext) | **PUT** /templates | Update template context +*TemplateProcessor.TemplateApi* | [**uploadTemplateFile**](docs/TemplateApi.md#uploadTemplateFile) | **POST** /templates/{templateId} | Upload template file + + +## Documentation for Models + + - [TemplateProcessor.ClaimParameters](docs/ClaimParameters.md) + - [TemplateProcessor.DataSetResponse](docs/DataSetResponse.md) + - [TemplateProcessor.Error](docs/Error.md) + - [TemplateProcessor.ErrorResponse](docs/ErrorResponse.md) + - [TemplateProcessor.Lifecycle](docs/Lifecycle.md) + - [TemplateProcessor.MergeJob](docs/MergeJob.md) + - [TemplateProcessor.MergeJobResponse](docs/MergeJobResponse.md) + - [TemplateProcessor.MergeSettings](docs/MergeSettings.md) + - [TemplateProcessor.OutputSettings](docs/OutputSettings.md) + - [TemplateProcessor.OwnerInfo](docs/OwnerInfo.md) + - [TemplateProcessor.ResultStreamRequest](docs/ResultStreamRequest.md) + - [TemplateProcessor.StorageLocation](docs/StorageLocation.md) + - [TemplateProcessor.StreamLocation](docs/StreamLocation.md) + - [TemplateProcessor.TemplateContext](docs/TemplateContext.md) + - [TemplateProcessor.TemplateContextRequest](docs/TemplateContextRequest.md) + - [TemplateProcessor.TemplateContextResponse](docs/TemplateContextResponse.md) + + +## Documentation for Authorization + + +### oauth2schema + +- **Type**: OAuth +- **Flow**: application +- **Authorization URL**: +- **Scopes**: + - global: accessEverything + diff --git a/javascript/git_push.sh b/javascript/git_push.sh new file mode 100644 index 0000000..0d041ad --- /dev/null +++ b/javascript/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/javascript/mocha.opts b/javascript/mocha.opts new file mode 100644 index 0000000..9070118 --- /dev/null +++ b/javascript/mocha.opts @@ -0,0 +1 @@ +--timeout 10000 diff --git a/javascript/package.json b/javascript/package.json new file mode 100644 index 0000000..84fedfa --- /dev/null +++ b/javascript/package.json @@ -0,0 +1,21 @@ +{ + "name": "template_processor", + "version": "0.1", + "description": "bThe_Template_Processor_API_can_generate_office_xml_and_json_documents_from_a_template_and_a_JSON_data_file__Supported_templates_are_MS_Office_files_and_freemarker_files_bThe_flow_is_generally_as_followsbInteractive_testing_bA_web_based_test_console_is_available_in_the_a_hrefhttpsstore_sphereon_comSphereon_API_Storea", + "license": "Apache License Version 2.0", + "main": "src/SphereonTemplateProcessor/index.js", + "scripts": { + "test": "./node_modules/mocha/bin/mocha --recursive" + }, + "browser": { + "fs": false + }, + "dependencies": { + "superagent": "3.5.2" + }, + "devDependencies": { + "mocha": "~2.3.4", + "sinon": "1.17.3", + "expect.js": "~0.3.1" + } +} diff --git a/javascript/test/api/AllApi.spec.js b/javascript/test/api/AllApi.spec.js new file mode 100644 index 0000000..6747448 --- /dev/null +++ b/javascript/test/api/AllApi.spec.js @@ -0,0 +1,186 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.AllApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AllApi', function() { + describe('createDataSet', function() { + it('should call createDataSet successfully', function(done) { + //uncomment below and update the code to test createDataSet + //instance.createDataSet(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('createTemplateContext', function() { + it('should call createTemplateContext successfully', function(done) { + //uncomment below and update the code to test createTemplateContext + //instance.createTemplateContext(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deleteDataSet', function() { + it('should call deleteDataSet successfully', function(done) { + //uncomment below and update the code to test deleteDataSet + //instance.deleteDataSet(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deleteJob', function() { + it('should call deleteJob successfully', function(done) { + //uncomment below and update the code to test deleteJob + //instance.deleteJob(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deleteTemplateContext', function() { + it('should call deleteTemplateContext successfully', function(done) { + //uncomment below and update the code to test deleteTemplateContext + //instance.deleteTemplateContext(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getJob', function() { + it('should call getJob successfully', function(done) { + //uncomment below and update the code to test getJob + //instance.getJob(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getJobs', function() { + it('should call getJobs successfully', function(done) { + //uncomment below and update the code to test getJobs + //instance.getJobs(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getResultStream', function() { + it('should call getResultStream successfully', function(done) { + //uncomment below and update the code to test getResultStream + //instance.getResultStream(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getResultStreamsAsContainer', function() { + it('should call getResultStreamsAsContainer successfully', function(done) { + //uncomment below and update the code to test getResultStreamsAsContainer + //instance.getResultStreamsAsContainer(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getTemplateContext', function() { + it('should call getTemplateContext successfully', function(done) { + //uncomment below and update the code to test getTemplateContext + //instance.getTemplateContext(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('submitJob', function() { + it('should call submitJob successfully', function(done) { + //uncomment below and update the code to test submitJob + //instance.submitJob(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('updateTemplateContext', function() { + it('should call updateTemplateContext successfully', function(done) { + //uncomment below and update the code to test updateTemplateContext + //instance.updateTemplateContext(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('uploadTemplateFile', function() { + it('should call uploadTemplateFile successfully', function(done) { + //uncomment below and update the code to test uploadTemplateFile + //instance.uploadTemplateFile(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/javascript/test/api/DataSetApi.spec.js b/javascript/test/api/DataSetApi.spec.js new file mode 100644 index 0000000..cb82796 --- /dev/null +++ b/javascript/test/api/DataSetApi.spec.js @@ -0,0 +1,76 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.DataSetApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('DataSetApi', function() { + describe('createDataSet', function() { + it('should call createDataSet successfully', function(done) { + //uncomment below and update the code to test createDataSet + //instance.createDataSet(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deleteDataSet', function() { + it('should call deleteDataSet successfully', function(done) { + //uncomment below and update the code to test deleteDataSet + //instance.deleteDataSet(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/javascript/test/api/JobApi.spec.js b/javascript/test/api/JobApi.spec.js new file mode 100644 index 0000000..21fb383 --- /dev/null +++ b/javascript/test/api/JobApi.spec.js @@ -0,0 +1,106 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.JobApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('JobApi', function() { + describe('getJob', function() { + it('should call getJob successfully', function(done) { + //uncomment below and update the code to test getJob + //instance.getJob(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getJobs', function() { + it('should call getJobs successfully', function(done) { + //uncomment below and update the code to test getJobs + //instance.getJobs(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getResultStream', function() { + it('should call getResultStream successfully', function(done) { + //uncomment below and update the code to test getResultStream + //instance.getResultStream(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getResultStreamsAsContainer', function() { + it('should call getResultStreamsAsContainer successfully', function(done) { + //uncomment below and update the code to test getResultStreamsAsContainer + //instance.getResultStreamsAsContainer(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('submitJob', function() { + it('should call submitJob successfully', function(done) { + //uncomment below and update the code to test submitJob + //instance.submitJob(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/javascript/test/api/TemplateApi.spec.js b/javascript/test/api/TemplateApi.spec.js new file mode 100644 index 0000000..e507f1f --- /dev/null +++ b/javascript/test/api/TemplateApi.spec.js @@ -0,0 +1,106 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.TemplateApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TemplateApi', function() { + describe('createTemplateContext', function() { + it('should call createTemplateContext successfully', function(done) { + //uncomment below and update the code to test createTemplateContext + //instance.createTemplateContext(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deleteTemplateContext', function() { + it('should call deleteTemplateContext successfully', function(done) { + //uncomment below and update the code to test deleteTemplateContext + //instance.deleteTemplateContext(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getTemplateContext', function() { + it('should call getTemplateContext successfully', function(done) { + //uncomment below and update the code to test getTemplateContext + //instance.getTemplateContext(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('updateTemplateContext', function() { + it('should call updateTemplateContext successfully', function(done) { + //uncomment below and update the code to test updateTemplateContext + //instance.updateTemplateContext(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('uploadTemplateFile', function() { + it('should call uploadTemplateFile successfully', function(done) { + //uncomment below and update the code to test uploadTemplateFile + //instance.uploadTemplateFile(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/javascript/test/model/ClaimParameters.spec.js b/javascript/test/model/ClaimParameters.spec.js new file mode 100644 index 0000000..f0cfa2f --- /dev/null +++ b/javascript/test/model/ClaimParameters.spec.js @@ -0,0 +1,92 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.1 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.ClaimParameters(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ClaimParameters', function() { + it('should create an instance of ClaimParameters', function() { + // uncomment below and update the code to test ClaimParameters + //var instane = new TemplateProcessor.ClaimParameters(); + //expect(instance).to.be.a(TemplateProcessor.ClaimParameters); + }); + + it('should have the property apiEndUser (base name: "apiEndUser")', function() { + // uncomment below and update the code to test the property apiEndUser + //var instane = new TemplateProcessor.ClaimParameters(); + //expect(instance).to.be(); + }); + + it('should have the property applicationId (base name: "applicationId")', function() { + // uncomment below and update the code to test the property applicationId + //var instane = new TemplateProcessor.ClaimParameters(); + //expect(instance).to.be(); + }); + + it('should have the property keyType (base name: "keyType")', function() { + // uncomment below and update the code to test the property keyType + //var instane = new TemplateProcessor.ClaimParameters(); + //expect(instance).to.be(); + }); + + it('should have the property sphereonIdentifier (base name: "sphereonIdentifier")', function() { + // uncomment below and update the code to test the property sphereonIdentifier + //var instane = new TemplateProcessor.ClaimParameters(); + //expect(instance).to.be(); + }); + + it('should have the property apiSupplierTenantId (base name: "apiSupplierTenantId")', function() { + // uncomment below and update the code to test the property apiSupplierTenantId + //var instane = new TemplateProcessor.ClaimParameters(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/DataSetResponse.spec.js b/javascript/test/model/DataSetResponse.spec.js new file mode 100644 index 0000000..21cdbfd --- /dev/null +++ b/javascript/test/model/DataSetResponse.spec.js @@ -0,0 +1,86 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.DataSetResponse(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('DataSetResponse', function() { + it('should create an instance of DataSetResponse', function() { + // uncomment below and update the code to test DataSetResponse + //var instane = new TemplateProcessor.DataSetResponse(); + //expect(instance).to.be.a(TemplateProcessor.DataSetResponse); + }); + + it('should have the property completionTime (base name: "completionTime")', function() { + // uncomment below and update the code to test the property completionTime + //var instane = new TemplateProcessor.DataSetResponse(); + //expect(instance).to.be(); + }); + + it('should have the property creationTime (base name: "creationTime")', function() { + // uncomment below and update the code to test the property creationTime + //var instane = new TemplateProcessor.DataSetResponse(); + //expect(instance).to.be(); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new TemplateProcessor.DataSetResponse(); + //expect(instance).to.be(); + }); + + it('should have the property status (base name: "status")', function() { + // uncomment below and update the code to test the property status + //var instane = new TemplateProcessor.DataSetResponse(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/Error.spec.js b/javascript/test/model/Error.spec.js new file mode 100644 index 0000000..ce8b8ee --- /dev/null +++ b/javascript/test/model/Error.spec.js @@ -0,0 +1,86 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.Error(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Error', function() { + it('should create an instance of Error', function() { + // uncomment below and update the code to test Error + //var instane = new TemplateProcessor.Error(); + //expect(instance).to.be.a(TemplateProcessor.Error); + }); + + it('should have the property code (base name: "code")', function() { + // uncomment below and update the code to test the property code + //var instane = new TemplateProcessor.Error(); + //expect(instance).to.be(); + }); + + it('should have the property level (base name: "level")', function() { + // uncomment below and update the code to test the property level + //var instane = new TemplateProcessor.Error(); + //expect(instance).to.be(); + }); + + it('should have the property cause (base name: "cause")', function() { + // uncomment below and update the code to test the property cause + //var instane = new TemplateProcessor.Error(); + //expect(instance).to.be(); + }); + + it('should have the property message (base name: "message")', function() { + // uncomment below and update the code to test the property message + //var instane = new TemplateProcessor.Error(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/ErrorResponse.spec.js b/javascript/test/model/ErrorResponse.spec.js new file mode 100644 index 0000000..39630cc --- /dev/null +++ b/javascript/test/model/ErrorResponse.spec.js @@ -0,0 +1,68 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.ErrorResponse(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ErrorResponse', function() { + it('should create an instance of ErrorResponse', function() { + // uncomment below and update the code to test ErrorResponse + //var instane = new TemplateProcessor.ErrorResponse(); + //expect(instance).to.be.a(TemplateProcessor.ErrorResponse); + }); + + it('should have the property errors (base name: "errors")', function() { + // uncomment below and update the code to test the property errors + //var instane = new TemplateProcessor.ErrorResponse(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/Lifecycle.spec.js b/javascript/test/model/Lifecycle.spec.js new file mode 100644 index 0000000..9f34256 --- /dev/null +++ b/javascript/test/model/Lifecycle.spec.js @@ -0,0 +1,80 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.Lifecycle(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Lifecycle', function() { + it('should create an instance of Lifecycle', function() { + // uncomment below and update the code to test Lifecycle + //var instane = new TemplateProcessor.Lifecycle(); + //expect(instance).to.be.a(TemplateProcessor.Lifecycle); + }); + + it('should have the property actionTime (base name: "actionTime")', function() { + // uncomment below and update the code to test the property actionTime + //var instane = new TemplateProcessor.Lifecycle(); + //expect(instance).to.be(); + }); + + it('should have the property action (base name: "action")', function() { + // uncomment below and update the code to test the property action + //var instane = new TemplateProcessor.Lifecycle(); + //expect(instance).to.be(); + }); + + it('should have the property type (base name: "type")', function() { + // uncomment below and update the code to test the property type + //var instane = new TemplateProcessor.Lifecycle(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/MergeJob.spec.js b/javascript/test/model/MergeJob.spec.js new file mode 100644 index 0000000..f2ac96c --- /dev/null +++ b/javascript/test/model/MergeJob.spec.js @@ -0,0 +1,122 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.MergeJob(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('MergeJob', function() { + it('should create an instance of MergeJob', function() { + // uncomment below and update the code to test MergeJob + //var instane = new TemplateProcessor.MergeJob(); + //expect(instance).to.be.a(TemplateProcessor.MergeJob); + }); + + it('should have the property completionTime (base name: "completionTime")', function() { + // uncomment below and update the code to test the property completionTime + //var instane = new TemplateProcessor.MergeJob(); + //expect(instance).to.be(); + }); + + it('should have the property jobId (base name: "jobId")', function() { + // uncomment below and update the code to test the property jobId + //var instane = new TemplateProcessor.MergeJob(); + //expect(instance).to.be(); + }); + + it('should have the property creationTime (base name: "creationTime")', function() { + // uncomment below and update the code to test the property creationTime + //var instane = new TemplateProcessor.MergeJob(); + //expect(instance).to.be(); + }); + + it('should have the property dataSetId (base name: "dataSetId")', function() { + // uncomment below and update the code to test the property dataSetId + //var instane = new TemplateProcessor.MergeJob(); + //expect(instance).to.be(); + }); + + it('should have the property resultStreams (base name: "resultStreams")', function() { + // uncomment below and update the code to test the property resultStreams + //var instane = new TemplateProcessor.MergeJob(); + //expect(instance).to.be(); + }); + + it('should have the property headerDataSetIds (base name: "headerDataSetIds")', function() { + // uncomment below and update the code to test the property headerDataSetIds + //var instane = new TemplateProcessor.MergeJob(); + //expect(instance).to.be(); + }); + + it('should have the property resultStorageLocation (base name: "resultStorageLocation")', function() { + // uncomment below and update the code to test the property resultStorageLocation + //var instane = new TemplateProcessor.MergeJob(); + //expect(instance).to.be(); + }); + + it('should have the property mergeSettings (base name: "mergeSettings")', function() { + // uncomment below and update the code to test the property mergeSettings + //var instane = new TemplateProcessor.MergeJob(); + //expect(instance).to.be(); + }); + + it('should have the property statusMessage (base name: "statusMessage")', function() { + // uncomment below and update the code to test the property statusMessage + //var instane = new TemplateProcessor.MergeJob(); + //expect(instance).to.be(); + }); + + it('should have the property status (base name: "status")', function() { + // uncomment below and update the code to test the property status + //var instane = new TemplateProcessor.MergeJob(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/MergeJobResponse.spec.js b/javascript/test/model/MergeJobResponse.spec.js new file mode 100644 index 0000000..d23b680 --- /dev/null +++ b/javascript/test/model/MergeJobResponse.spec.js @@ -0,0 +1,86 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.MergeJobResponse(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('MergeJobResponse', function() { + it('should create an instance of MergeJobResponse', function() { + // uncomment below and update the code to test MergeJobResponse + //var instane = new TemplateProcessor.MergeJobResponse(); + //expect(instance).to.be.a(TemplateProcessor.MergeJobResponse); + }); + + it('should have the property jobId (base name: "jobId")', function() { + // uncomment below and update the code to test the property jobId + //var instane = new TemplateProcessor.MergeJobResponse(); + //expect(instance).to.be(); + }); + + it('should have the property job (base name: "job")', function() { + // uncomment below and update the code to test the property job + //var instane = new TemplateProcessor.MergeJobResponse(); + //expect(instance).to.be(); + }); + + it('should have the property statusMessage (base name: "statusMessage")', function() { + // uncomment below and update the code to test the property statusMessage + //var instane = new TemplateProcessor.MergeJobResponse(); + //expect(instance).to.be(); + }); + + it('should have the property status (base name: "status")', function() { + // uncomment below and update the code to test the property status + //var instane = new TemplateProcessor.MergeJobResponse(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/MergeSettings.spec.js b/javascript/test/model/MergeSettings.spec.js new file mode 100644 index 0000000..534acb0 --- /dev/null +++ b/javascript/test/model/MergeSettings.spec.js @@ -0,0 +1,116 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.MergeSettings(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('MergeSettings', function() { + it('should create an instance of MergeSettings', function() { + // uncomment below and update the code to test MergeSettings + //var instane = new TemplateProcessor.MergeSettings(); + //expect(instance).to.be.a(TemplateProcessor.MergeSettings); + }); + + it('should have the property lifecycle (base name: "lifecycle")', function() { + // uncomment below and update the code to test the property lifecycle + //var instane = new TemplateProcessor.MergeSettings(); + //expect(instance).to.be(); + }); + + it('should have the property mergeResult (base name: "mergeResult")', function() { + // uncomment below and update the code to test the property mergeResult + //var instane = new TemplateProcessor.MergeSettings(); + //expect(instance).to.be(); + }); + + it('should have the property dataSetId (base name: "dataSetId")', function() { + // uncomment below and update the code to test the property dataSetId + //var instane = new TemplateProcessor.MergeSettings(); + //expect(instance).to.be(); + }); + + it('should have the property engine (base name: "engine")', function() { + // uncomment below and update the code to test the property engine + //var instane = new TemplateProcessor.MergeSettings(); + //expect(instance).to.be(); + }); + + it('should have the property headerDataSetIds (base name: "headerDataSetIds")', function() { + // uncomment below and update the code to test the property headerDataSetIds + //var instane = new TemplateProcessor.MergeSettings(); + //expect(instance).to.be(); + }); + + it('should have the property resultStorageLocation (base name: "resultStorageLocation")', function() { + // uncomment below and update the code to test the property resultStorageLocation + //var instane = new TemplateProcessor.MergeSettings(); + //expect(instance).to.be(); + }); + + it('should have the property templateVersion (base name: "templateVersion")', function() { + // uncomment below and update the code to test the property templateVersion + //var instane = new TemplateProcessor.MergeSettings(); + //expect(instance).to.be(); + }); + + it('should have the property templateId (base name: "templateId")', function() { + // uncomment below and update the code to test the property templateId + //var instane = new TemplateProcessor.MergeSettings(); + //expect(instance).to.be(); + }); + + it('should have the property outputSettings (base name: "outputSettings")', function() { + // uncomment below and update the code to test the property outputSettings + //var instane = new TemplateProcessor.MergeSettings(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/OutputSettings.spec.js b/javascript/test/model/OutputSettings.spec.js new file mode 100644 index 0000000..69da405 --- /dev/null +++ b/javascript/test/model/OutputSettings.spec.js @@ -0,0 +1,74 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.OutputSettings(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OutputSettings', function() { + it('should create an instance of OutputSettings', function() { + // uncomment below and update the code to test OutputSettings + //var instane = new TemplateProcessor.OutputSettings(); + //expect(instance).to.be.a(TemplateProcessor.OutputSettings); + }); + + it('should have the property deliveryFormat (base name: "deliveryFormat")', function() { + // uncomment below and update the code to test the property deliveryFormat + //var instane = new TemplateProcessor.OutputSettings(); + //expect(instance).to.be(); + }); + + it('should have the property outputFormat (base name: "outputFormat")', function() { + // uncomment below and update the code to test the property outputFormat + //var instane = new TemplateProcessor.OutputSettings(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/OwnerInfo.spec.js b/javascript/test/model/OwnerInfo.spec.js new file mode 100644 index 0000000..3849e96 --- /dev/null +++ b/javascript/test/model/OwnerInfo.spec.js @@ -0,0 +1,86 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.OwnerInfo(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OwnerInfo', function() { + it('should create an instance of OwnerInfo', function() { + // uncomment below and update the code to test OwnerInfo + //var instane = new TemplateProcessor.OwnerInfo(); + //expect(instance).to.be.a(TemplateProcessor.OwnerInfo); + }); + + it('should have the property phone (base name: "phone")', function() { + // uncomment below and update the code to test the property phone + //var instane = new TemplateProcessor.OwnerInfo(); + //expect(instance).to.be(); + }); + + it('should have the property companyDepartment (base name: "companyDepartment")', function() { + // uncomment below and update the code to test the property companyDepartment + //var instane = new TemplateProcessor.OwnerInfo(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new TemplateProcessor.OwnerInfo(); + //expect(instance).to.be(); + }); + + it('should have the property email (base name: "email")', function() { + // uncomment below and update the code to test the property email + //var instane = new TemplateProcessor.OwnerInfo(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/ResultStreamRequest.spec.js b/javascript/test/model/ResultStreamRequest.spec.js new file mode 100644 index 0000000..15dba87 --- /dev/null +++ b/javascript/test/model/ResultStreamRequest.spec.js @@ -0,0 +1,74 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.ResultStreamRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ResultStreamRequest', function() { + it('should create an instance of ResultStreamRequest', function() { + // uncomment below and update the code to test ResultStreamRequest + //var instane = new TemplateProcessor.ResultStreamRequest(); + //expect(instance).to.be.a(TemplateProcessor.ResultStreamRequest); + }); + + it('should have the property streamLocation (base name: "streamLocation")', function() { + // uncomment below and update the code to test the property streamLocation + //var instane = new TemplateProcessor.ResultStreamRequest(); + //expect(instance).to.be(); + }); + + it('should have the property outputSettings (base name: "outputSettings")', function() { + // uncomment below and update the code to test the property outputSettings + //var instane = new TemplateProcessor.ResultStreamRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/StorageLocation.spec.js b/javascript/test/model/StorageLocation.spec.js new file mode 100644 index 0000000..7caad3c --- /dev/null +++ b/javascript/test/model/StorageLocation.spec.js @@ -0,0 +1,74 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.StorageLocation(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('StorageLocation', function() { + it('should create an instance of StorageLocation', function() { + // uncomment below and update the code to test StorageLocation + //var instane = new TemplateProcessor.StorageLocation(); + //expect(instance).to.be.a(TemplateProcessor.StorageLocation); + }); + + it('should have the property folderPath (base name: "folderPath")', function() { + // uncomment below and update the code to test the property folderPath + //var instane = new TemplateProcessor.StorageLocation(); + //expect(instance).to.be(); + }); + + it('should have the property containerId (base name: "containerId")', function() { + // uncomment below and update the code to test the property containerId + //var instane = new TemplateProcessor.StorageLocation(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/StreamLocation.spec.js b/javascript/test/model/StreamLocation.spec.js new file mode 100644 index 0000000..d0250e1 --- /dev/null +++ b/javascript/test/model/StreamLocation.spec.js @@ -0,0 +1,86 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.StreamLocation(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('StreamLocation', function() { + it('should create an instance of StreamLocation', function() { + // uncomment below and update the code to test StreamLocation + //var instane = new TemplateProcessor.StreamLocation(); + //expect(instance).to.be.a(TemplateProcessor.StreamLocation); + }); + + it('should have the property folderPath (base name: "folderPath")', function() { + // uncomment below and update the code to test the property folderPath + //var instane = new TemplateProcessor.StreamLocation(); + //expect(instance).to.be(); + }); + + it('should have the property originalFileName (base name: "originalFileName")', function() { + // uncomment below and update the code to test the property originalFileName + //var instane = new TemplateProcessor.StreamLocation(); + //expect(instance).to.be(); + }); + + it('should have the property fileName (base name: "fileName")', function() { + // uncomment below and update the code to test the property fileName + //var instane = new TemplateProcessor.StreamLocation(); + //expect(instance).to.be(); + }); + + it('should have the property containerId (base name: "containerId")', function() { + // uncomment below and update the code to test the property containerId + //var instane = new TemplateProcessor.StreamLocation(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/TemplateContext.spec.js b/javascript/test/model/TemplateContext.spec.js new file mode 100644 index 0000000..c8236db --- /dev/null +++ b/javascript/test/model/TemplateContext.spec.js @@ -0,0 +1,104 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.TemplateContext(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TemplateContext', function() { + it('should create an instance of TemplateContext', function() { + // uncomment below and update the code to test TemplateContext + //var instane = new TemplateProcessor.TemplateContext(); + //expect(instance).to.be.a(TemplateProcessor.TemplateContext); + }); + + it('should have the property templateType (base name: "templateType")', function() { + // uncomment below and update the code to test the property templateType + //var instane = new TemplateProcessor.TemplateContext(); + //expect(instance).to.be(); + }); + + it('should have the property templateFileLocations (base name: "templateFileLocations")', function() { + // uncomment below and update the code to test the property templateFileLocations + //var instane = new TemplateProcessor.TemplateContext(); + //expect(instance).to.be(); + }); + + it('should have the property description (base name: "description")', function() { + // uncomment below and update the code to test the property description + //var instane = new TemplateProcessor.TemplateContext(); + //expect(instance).to.be(); + }); + + it('should have the property ownerInfo (base name: "ownerInfo")', function() { + // uncomment below and update the code to test the property ownerInfo + //var instane = new TemplateProcessor.TemplateContext(); + //expect(instance).to.be(); + }); + + it('should have the property storageLocation (base name: "storageLocation")', function() { + // uncomment below and update the code to test the property storageLocation + //var instane = new TemplateProcessor.TemplateContext(); + //expect(instance).to.be(); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new TemplateProcessor.TemplateContext(); + //expect(instance).to.be(); + }); + + it('should have the property templateId (base name: "templateId")', function() { + // uncomment below and update the code to test the property templateId + //var instane = new TemplateProcessor.TemplateContext(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/TemplateContextRequest.spec.js b/javascript/test/model/TemplateContextRequest.spec.js new file mode 100644 index 0000000..2eed82a --- /dev/null +++ b/javascript/test/model/TemplateContextRequest.spec.js @@ -0,0 +1,86 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.TemplateContextRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TemplateContextRequest', function() { + it('should create an instance of TemplateContextRequest', function() { + // uncomment below and update the code to test TemplateContextRequest + //var instane = new TemplateProcessor.TemplateContextRequest(); + //expect(instance).to.be.a(TemplateProcessor.TemplateContextRequest); + }); + + it('should have the property templateType (base name: "templateType")', function() { + // uncomment below and update the code to test the property templateType + //var instane = new TemplateProcessor.TemplateContextRequest(); + //expect(instance).to.be(); + }); + + it('should have the property description (base name: "description")', function() { + // uncomment below and update the code to test the property description + //var instane = new TemplateProcessor.TemplateContextRequest(); + //expect(instance).to.be(); + }); + + it('should have the property ownerInfo (base name: "ownerInfo")', function() { + // uncomment below and update the code to test the property ownerInfo + //var instane = new TemplateProcessor.TemplateContextRequest(); + //expect(instance).to.be(); + }); + + it('should have the property templateId (base name: "templateId")', function() { + // uncomment below and update the code to test the property templateId + //var instane = new TemplateProcessor.TemplateContextRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/javascript/test/model/TemplateContextResponse.spec.js b/javascript/test/model/TemplateContextResponse.spec.js new file mode 100644 index 0000000..c82e490 --- /dev/null +++ b/javascript/test/model/TemplateContextResponse.spec.js @@ -0,0 +1,86 @@ +/** + * Template-Processor + * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store + * + * OpenAPI spec version: 0.1 + * Contact: dev@sphereon.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.TemplateProcessor); + } +}(this, function(expect, TemplateProcessor) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new TemplateProcessor.TemplateContextResponse(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TemplateContextResponse', function() { + it('should create an instance of TemplateContextResponse', function() { + // uncomment below and update the code to test TemplateContextResponse + //var instane = new TemplateProcessor.TemplateContextResponse(); + //expect(instance).to.be.a(TemplateProcessor.TemplateContextResponse); + }); + + it('should have the property creationTime (base name: "creationTime")', function() { + // uncomment below and update the code to test the property creationTime + //var instane = new TemplateProcessor.TemplateContextResponse(); + //expect(instance).to.be(); + }); + + it('should have the property context (base name: "context")', function() { + // uncomment below and update the code to test the property context + //var instane = new TemplateProcessor.TemplateContextResponse(); + //expect(instance).to.be(); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new TemplateProcessor.TemplateContextResponse(); + //expect(instance).to.be(); + }); + + it('should have the property status (base name: "status")', function() { + // uncomment below and update the code to test the property status + //var instane = new TemplateProcessor.TemplateContextResponse(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/pom.xml b/pom.xml index e9e927e..984a804 100644 --- a/pom.xml +++ b/pom.xml @@ -1,233 +1,403 @@ - 4.0.0 - com.sphereon.sdk - template-processor-sdk-generator - pom - 0.1.3-SNAPSHOT - Template Processor SDK Generator - - - - UTF-8 - 1.8 - ${java.version} - ${java.version} - swagger.sdk.json - 1.5.9 - 2.4.2 - 1.5.9 - 2.7.5 - 2.6.2 - 2.9.3 - 1.0.0 - 4.12 - com.sphereon.sdk.template.processor - Sphereon.SDK.Template.Processor - 2.5.3 - 1.9.5 - 1.6.0 - - - - - sphereon-sdk-releases - http://nexus.qa.sphereon.com/nexus/content/repositories/sphereon-sdk-releases - - - sphereon-sdk-snapshots - http://nexus.qa.sphereon.com/nexus/content/repositories/sphereon-sdk-snapshots - - - - - - - maven-release-plugin - ${maven-release-plugin.version} - - true - - false - true - - v@{project.version} - - - - org.apache.maven.scm - maven-scm-provider-gitexe - ${maven-scm-provider-gitexe.version} - - - - - com.amashchenko.maven.plugin - gitflow-maven-plugin - ${gitflow-maven-plugin.version} - - - - - - - - - - java8 - - false - - - - - - io.swagger - swagger-codegen-maven-plugin - 2.2.1 - - - - - - generate - - - - ${swagger-file} - - - - java - - - - java8 - - - - okhttp-gson - true - - ${project.basedir}/java8 - com.sphereon.sdk - template-processor-sdk-java8 - ${project.version} - true - ${sdk-package}.api - ${sdk-package}.model - ${sdk-package}.handler - - - - - - - - - csharp-net45 - - false - - - - - - io.swagger - swagger-codegen-maven-plugin - 2.2.1 - - - - - - generate - - - - ${swagger-file} - - - csharp - - - - - Sphereon BV - ${sdk-package-csharp}.Api - ${sdk-package-csharp}.TESTTESTModel - ${sdk-package-csharp}.Handler - ${sdk-package-csharp} - - - - - src/main/resources/config/csharp-net45.json - - - true - - ${project.basedir}/csharp-net45 - com.sphereon.sdk - template-processor-sdk-csharp-net45 - ${project.version} - true - - Api - Model - Handler - - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - - - - - com.squareup.okhttp - okhttp - ${okhttp-version} - - - - com.squareup.okhttp - logging-interceptor - ${okhttp-version} - - - - - - com.google.code.gson - gson - ${gson-version} - - - - - - com.brsanthu - migbase64 - 2.2 - - - - junit - junit - ${junit-version} - - - + 4.0.0 + com.sphereon.sdk + template-processor + jar + 0.1.2 + template processor API SDK Generator + + + Sphereon BV + com.sphereon.sdk.template-processor + Sphereon.SDK.TemplateProcessor + SphereonTemplateProcessor + 0.1.1 + + 2.3.1 + false + UTF-8 + 2.5.3 + 1.9.5 + + + + + sphereon-sdk-releases + http://nexus.qa.sphereon.com/nexus/content/repositories/sphereon-sdk-releases + + + sphereon-sdk-snapshots + http://nexus.qa.sphereon.com/nexus/content/repositories/sphereon-sdk-snapshots + + + + + + html-docs + + + + io.swagger + swagger-codegen-maven-plugin + ${swagger-coden-maven-plugin.version} + + + + generate + + + swagger.sdk.json + html2 + + java8 + + ${swagger-coden-verbose} + ${project.basedir}/html-docs + com.sphereon.sdk + template-processor-sdk-html-docs + ${project.version} + true + api + model + ${sdk-package} + + + + + + + + + + java8-okhttp-gson + + + + io.swagger + swagger-codegen-maven-plugin + ${swagger-coden-maven-plugin.version} + + + + generate + + + swagger.sdk.json + java + + ${basedir}/src/main/mustacheTemplates/okhttp-gson + + + java8 + + okhttp-gson + ${swagger-coden-verbose} + ${project.basedir}/java8-okhttp-gson + com.sphereon.sdk + template-processor-sdk-java8-okhttp-gson + ${project.version} + true + ${sdk-package}.api + ${sdk-package}.model + ${sdk-package}.handler + + + + + + + + + + java8-jersey2 + + + + io.swagger + swagger-codegen-maven-plugin + ${swagger-coden-maven-plugin.version} + + + + generate + + + swagger.sdk.json + java + + java8 + + jersey2 + ${swagger-coden-verbose} + ${project.basedir}/java8-jersey2 + com.sphereon.sdk + template-processor-sdk-java8-jersey2 + ${project.version} + true + ${sdk-package}.api + ${sdk-package}.model + ${sdk-package}.handler + + + + + + + + + + + java8-retrofit2 + + + + io.swagger + swagger-codegen-maven-plugin + ${swagger-coden-maven-plugin.version} + + + + generate + + + swagger.sdk.json + java + + java8 + + retrofit2 + ${swagger-coden-verbose} + ${project.basedir}/java8-retrofit2 + com.sphereon.sdk + template-processor-sdk-java8-retrofit2 + ${project.version} + true + ${sdk-package}.api + ${sdk-package}.model + ${sdk-package}.handler + + + + + + + + + + javascript + + + + io.swagger + swagger-codegen-maven-plugin + ${swagger-coden-maven-plugin.version} + + + + generate + + + swagger.sdk.json + javascript + + java8 + + ${swagger-coden-verbose} + ${project.basedir}/javascript + com.sphereon.sdk + template-processor-sdk-javascript + ${project.version} + true + api + model + ${sdk-package-javascript} + + + + + + + + + + typescript-angular + + + + io.swagger + swagger-codegen-maven-plugin + ${swagger-coden-maven-plugin.version} + + + + generate + + + swagger.sdk.json + typescript-angular + + java8 + 5.1.1 + + ${swagger-coden-verbose} + ${project.basedir}/typescript-angular2/sdk + com.sphereon.sdk + template-processor-sdk-angular2 + ${project.version} + true + api + model + ${sdk-package-javascript} + + + + + + + + + + csharp-net45 + + + + io.swagger + swagger-codegen-maven-plugin + ${swagger-coden-maven-plugin.version} + + + + + + generate + + + swagger.sdk.json + csharp + + ${basedir}/src/main/mustacheTemplates/csharp + + + ${company-name} + ${sdk-package-csharp}.Api + ${sdk-package-csharp}.Model + ${sdk-package-csharp}.Handler + ${sdk-package-csharp} + ${sdk-package-version} + + src/main/resources/config/csharp-net45.json + ${swagger-coden-verbose} + ${project.basedir}/csharp-net45 + com.sphereon.sdk + template-processor-sdk-csharp-net45 + ${project.version} + true + Api + Model + Handler + + + + + + + + + + csharp-net35 + + + + io.swagger + swagger-codegen-maven-plugin + ${swagger-coden-maven-plugin.version} + + + + generate + + + swagger.sdk.json + csharp + + ${company-name} + ${sdk-package-csharp}.Api + ${sdk-package-csharp}.Model + ${sdk-package-csharp}.Handler + ${sdk-package-csharp} + ${sdk-package-version} + v3.5 + + src/main/resources/config/csharp-net35.json + ${swagger-coden-verbose} + ${project.basedir}/csharp-net35 + com.sphereon.sdk + template-processor-sdk-csharp-net35 + ${project.version} + true + Api + Model + Handler + + + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + default-compile + none + + + + + org.apache.maven.plugins + maven-install-plugin + + + default-install + none + + + + + + maven-release-plugin + ${maven-release-plugin.version} + + true + + false + true + + v@{project.version} + + + + org.apache.maven.scm + maven-scm-provider-gitexe + ${maven-scm-provider-gitexe.version} + + + + + com.amashchenko.maven.plugin + gitflow-maven-plugin + 1.5.0 + + + + + + + diff --git a/src/main/certificates/Sphereon.SDK.Blockchain.Proof.snk b/src/main/certificates/Sphereon.SDK.Blockchain.Proof.snk new file mode 100644 index 0000000..2e1b5b5 Binary files /dev/null and b/src/main/certificates/Sphereon.SDK.Blockchain.Proof.snk differ diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ApiClient.cs b/src/main/mustacheTemplates/csharp/ApiClient.mustache similarity index 79% rename from csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ApiClient.cs rename to src/main/mustacheTemplates/csharp/ApiClient.mustache index f46406f..b6e7162 100644 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ApiClient.cs +++ b/src/main/mustacheTemplates/csharp/ApiClient.mustache @@ -1,44 +1,33 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +{{>partial_header}} using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Text.RegularExpressions; using System.IO; +{{^netStandard}} +{{^supportsUWP}} using System.Web; +{{/supportsUWP}} +{{/netStandard}} using System.Linq; using System.Net; using System.Text; using Newtonsoft.Json; +{{#netStandard}} +using RestSharp.Portable; +using RestSharp.Portable.HttpClient; +{{/netStandard}} +{{^netStandard}} using RestSharp; +{{/netStandard}} -namespace Sphereon.SDK.Template.Processor.Client +namespace {{packageName}}.Client { ///

/// API client is mainly responsible for making the HTTP call to the API backend. /// - public partial class ApiClient + {{>visibility}} partial class ApiClient { private JsonSerializerSettings serializerSettings = new JsonSerializerSettings { @@ -60,17 +49,23 @@ public partial class ApiClient /// /// Initializes a new instance of the class - /// with default configuration and base path (https://gw.api.cloud.sphereon.com/). + /// with default configuration and base path ({{{basePath}}}). /// public ApiClient() { Configuration = Configuration.Default; - RestClient = new RestClient("https://gw.api.cloud.sphereon.com/"); + var basePath = "{{{basePath}}}"; + if (!basePath.EndsWith("/")) + basePath += '/'; + RestClient = new RestClient(basePath); + {{#netStandard}} + RestClient.IgnoreResponseStatusCode = true; + {{/netStandard}} } /// /// Initializes a new instance of the class - /// with default base path (https://gw.api.cloud.sphereon.com/). + /// with default base path ({{{basePath}}}). /// /// An instance of Configuration. public ApiClient(Configuration config = null) @@ -80,7 +75,13 @@ public ApiClient(Configuration config = null) else Configuration = config; - RestClient = new RestClient("https://gw.api.cloud.sphereon.com/"); + var basePath = "{{{basePath}}}"; + if (!basePath.EndsWith("/")) + basePath += '/'; + RestClient = new RestClient(basePath); + {{#netStandard}} + RestClient.IgnoreResponseStatusCode = true; + {{/netStandard}} } /// @@ -88,12 +89,17 @@ public ApiClient(Configuration config = null) /// with default configuration. /// /// The base path. - public ApiClient(String basePath = "https://gw.api.cloud.sphereon.com/") + public ApiClient(String basePath = "{{{basePath}}}") { if (String.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + if (!basePath.EndsWith("/")) + basePath += '/'; RestClient = new RestClient(basePath); + {{#netStandard}} + RestClient.IgnoreResponseStatusCode = true; + {{/netStandard}} Configuration = Configuration.Default; } @@ -118,12 +124,16 @@ public ApiClient(String basePath = "https://gw.api.cloud.sphereon.com/") // Creates and sets up a RestRequest prior to a call. private RestRequest PrepareRequest( - String path, RestSharp.Method method, Dictionary queryParams, Object postBody, + String path, {{^netStandard}}RestSharp.{{/netStandard}}Method method, Dictionary queryParams, Object postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, Dictionary pathParams, String contentType) { var request = new RestRequest(path, method); + {{#netStandard}} + // disable ResetSharp.Portable built-in serialization + request.Serializer = null; + {{/netStandard}} // add path parameter, if any foreach(var param in pathParams) @@ -144,18 +154,40 @@ private RestRequest PrepareRequest( // add file parameter, if any foreach(var param in fileParams) { + {{#netStandard}} + request.AddFile(param.Value); + {{/netStandard}} + {{^netStandard}} + {{^supportsUWP}} request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); + {{/supportsUWP}} + {{#supportsUWP}} + byte[] paramWriter = null; + param.Value.Writer = delegate (Stream stream) { paramWriter = ToByteArray(stream); }; + request.AddFile(param.Value.Name, paramWriter, param.Value.FileName, param.Value.ContentType); + {{/supportsUWP}} + {{/netStandard}} } if (postBody != null) // http body (model or byte[]) parameter { if (postBody.GetType() == typeof(String)) { + {{#netStandard}} + request.AddParameter(new Parameter { Value = postBody, Type = ParameterType.RequestBody, ContentType = "application/json" }); + {{/netStandard}} + {{^netStandard}} request.AddParameter("application/json", postBody, ParameterType.RequestBody); + {{/netStandard}} } else if (postBody.GetType() == typeof(byte[])) { + {{#netStandard}} + request.AddParameter(new Parameter { Value = postBody, Type = ParameterType.RequestBody, ContentType = contentType }); + {{/netStandard}} + {{^netStandard}} request.AddParameter(contentType, postBody, ParameterType.RequestBody); + {{/netStandard}} } } @@ -176,7 +208,7 @@ private RestRequest PrepareRequest( /// Content Type of the request /// Object public Object CallApi( - String path, RestSharp.Method method, Dictionary queryParams, Object postBody, + String path, {{^netStandard}}RestSharp.{{/netStandard}}Method method, Dictionary queryParams, Object postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, Dictionary pathParams, String contentType) @@ -191,11 +223,23 @@ public Object CallApi( RestClient.UserAgent = Configuration.UserAgent; InterceptRequest(request); + {{#netStandard}} + var response = RestClient.Execute(request).Result; + {{/netStandard}} + {{^netStandard}} + {{^supportsUWP}} var response = RestClient.Execute(request); + {{/supportsUWP}} + {{#supportsUWP}} + // Using async method to perform sync call (uwp-only) + var response = RestClient.ExecuteTaskAsync(request).Result; + {{/supportsUWP}} + {{/netStandard}} InterceptResponse(request, response); return (Object) response; } + {{#supportsAsync}} /// /// Makes the asynchronous HTTP request. /// @@ -210,7 +254,7 @@ public Object CallApi( /// Content type. /// The Task instance. public async System.Threading.Tasks.Task CallApiAsync( - String path, RestSharp.Method method, Dictionary queryParams, Object postBody, + String path, {{^netStandard}}RestSharp.{{/netStandard}}Method method, Dictionary queryParams, Object postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, Dictionary pathParams, String contentType) @@ -219,10 +263,10 @@ public async System.Threading.Tasks.Task CallApiAsync( path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams, contentType); InterceptRequest(request); - var response = await RestClient.ExecuteTaskAsync(request); + var response = await RestClient.Execute{{^netStandard}}TaskAsync{{/netStandard}}(request); InterceptResponse(request, response); return (Object)response; - } + }{{/supportsAsync}} /// /// Escape string (url-encoded). @@ -292,7 +336,7 @@ public string ParameterToString(object obj) /// Object representation of the JSON string. public object Deserialize(IRestResponse response, Type type) { - IList headers = response.Headers; + {{^netStandard}}IList{{/netStandard}}{{#netStandard}}IHttpHeaders{{/netStandard}} headers = response.Headers; if (type == typeof(byte[])) // return byte array { return response.RawBytes; @@ -412,7 +456,7 @@ public static string Base64Encode(string text) /// Object to be casted /// Target type /// Casted object - public static dynamic ConvertType(dynamic source, Type dest) + {{#supportsAsync}}public static dynamic ConvertType(dynamic source, Type dest){{/supportsAsync}}{{^supportsAsync}}public static object ConvertType(T source, Type dest) where T : class{{/supportsAsync}} { return Convert.ChangeType(source, dest); } @@ -490,5 +534,22 @@ public static string SanitizeFilename(string filename) return filename; } } + {{^netStandard}} + {{#supportsUWP}} + /// + /// Convert stream to byte array + /// + /// IO stream + /// Byte array + public static byte[] ToByteArray(Stream stream) + { + stream.Position = 0; + byte[] buffer = new byte[stream.Length]; + for (int totalBytesCopied = 0; totalBytesCopied < stream.Length;) + totalBytesCopied += stream.Read(buffer, totalBytesCopied, Convert.ToInt32(stream.Length) - totalBytesCopied); + return buffer; + } + {{/supportsUWP}} + {{/netStandard}} } } diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ApiException.cs b/src/main/mustacheTemplates/csharp/ApiException.mustache similarity index 51% rename from csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ApiException.cs rename to src/main/mustacheTemplates/csharp/ApiException.mustache index ed21a4e..ca80445 100644 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ApiException.cs +++ b/src/main/mustacheTemplates/csharp/ApiException.mustache @@ -1,33 +1,12 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +{{>partial_header}} using System; -namespace Sphereon.SDK.Template.Processor.Client +namespace {{packageName}}.Client { /// /// API Exception /// - public class ApiException : Exception + {{>visibility}} class ApiException : Exception { /// /// Gets or sets the error code (HTTP status code) @@ -39,7 +18,7 @@ public class ApiException : Exception /// Gets or sets the error content (body json object) /// /// The error content (Http response body). - public dynamic ErrorContent { get; private set; } + public {{#supportsAsync}}dynamic{{/supportsAsync}}{{^supportsAsync}}object{{/supportsAsync}} ErrorContent { get; private set; } /// /// Initializes a new instance of the class. @@ -62,7 +41,7 @@ public ApiException(int errorCode, string message) : base(message) /// HTTP status code. /// Error message. /// Error content. - public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message) + public ApiException(int errorCode, string message, {{#supportsAsync}}dynamic{{/supportsAsync}}{{^supportsAsync}}object{{/supportsAsync}} errorContent = null) : base(message) { this.ErrorCode = errorCode; this.ErrorContent = errorContent; diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ApiResponse.cs b/src/main/mustacheTemplates/csharp/ApiResponse.mustache similarity index 51% rename from csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ApiResponse.cs rename to src/main/mustacheTemplates/csharp/ApiResponse.mustache index 7852705..d04575d 100644 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/ApiResponse.cs +++ b/src/main/mustacheTemplates/csharp/ApiResponse.mustache @@ -1,34 +1,13 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +{{>partial_header}} using System; using System.Collections.Generic; -namespace Sphereon.SDK.Template.Processor.Client +namespace {{packageName}}.Client { /// /// API Response /// - public class ApiResponse + {{>visibility}} class ApiResponse { /// /// Gets or sets the status code (HTTP status code) diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Properties/AssemblyInfo.cs b/src/main/mustacheTemplates/csharp/AssemblyInfo.mustache similarity index 71% rename from csharp-net45/src/Sphereon.SDK.Template.Processor/Properties/AssemblyInfo.cs rename to src/main/mustacheTemplates/csharp/AssemblyInfo.mustache index f3b9f7d..bf80d7d 100644 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Properties/AssemblyInfo.cs +++ b/src/main/mustacheTemplates/csharp/AssemblyInfo.mustache @@ -4,12 +4,12 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Swagger Library")] -[assembly: AssemblyDescription("A library generated from a Swagger doc")] +[assembly: AssemblyTitle("{{packageTitle}}")] +[assembly: AssemblyDescription("{{packageDescription}}")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Swagger")] -[assembly: AssemblyProduct("SwaggerLibrary")] -[assembly: AssemblyCopyright("No Copyright")] +[assembly: AssemblyCompany("{{packageCompany}}")] +[assembly: AssemblyProduct("{{packageProductName}}")] +[assembly: AssemblyCopyright("{{packageCopyright}}")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -28,5 +28,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("1.0.0")] +[assembly: AssemblyVersion("{{packageVersion}}")] +[assembly: AssemblyFileVersion("{{packageVersion}}")] diff --git a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/Configuration.cs b/src/main/mustacheTemplates/csharp/Configuration.mustache similarity index 86% rename from csharp-net45/src/Sphereon.SDK.Template.Processor/Client/Configuration.cs rename to src/main/mustacheTemplates/csharp/Configuration.mustache index 90671ba..c4133bc 100644 --- a/csharp-net45/src/Sphereon.SDK.Template.Processor/Client/Configuration.cs +++ b/src/main/mustacheTemplates/csharp/Configuration.mustache @@ -1,25 +1,4 @@ -/* - * Template-Processor - * - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +{{>partial_header}} using System; using System.Reflection; using System.Collections.Generic; @@ -27,12 +6,12 @@ using System.Linq; using System.Text; -namespace Sphereon.SDK.Template.Processor.Client +namespace {{packageName}}.Client { /// /// Represents a set of configuration settings /// - public class Configuration + {{>visibility}} class Configuration { /// /// Initializes a new instance of the Configuration class with different settings @@ -58,7 +37,7 @@ public Configuration(ApiClient apiClient = null, string tempFolderPath = null, string dateTimeFormat = null, int timeout = 100000, - string userAgent = "Swagger-Codegen/1.0.0/csharp" + string userAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{packageVersion}}/csharp{{/httpUserAgent}}" ) { setApiClientUsingDefault(apiClient); @@ -77,7 +56,7 @@ public Configuration(ApiClient apiClient = null, TempFolderPath = tempFolderPath; DateTimeFormat = dateTimeFormat; - Timeout = timeout; + Timeout = {{#netStandard}}TimeSpan.FromMilliseconds({{/netStandard}}timeout{{#netStandard}}){{/netStandard}}; } /// @@ -93,7 +72,7 @@ public Configuration(ApiClient apiClient) /// Version of the package. /// /// Version of the package. - public const string Version = "1.0.0"; + public const string Version = "{{packageVersion}}"; /// /// Gets or sets the default Configuration. @@ -108,7 +87,9 @@ public Configuration(ApiClient apiClient) { int status = (int) response.StatusCode; if (status >= 400) return new ApiException(status, String.Format("Error calling {0}: {1}", methodName, response.Content), response.Content); + {{^netStandard}} if (status == 0) return new ApiException(status, String.Format("Error calling {0}: {1}", methodName, response.ErrorMessage), response.ErrorMessage); + {{/netStandard}} return null; }; @@ -116,7 +97,7 @@ public Configuration(ApiClient apiClient) /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. /// /// Timeout. - public int Timeout + public {{^netStandard}}int{{/netStandard}}{{#netStandard}}TimeSpan?{{/netStandard}} Timeout { get { return ApiClient.RestClient.Timeout; } @@ -255,7 +236,7 @@ public string GetApiKeyWithPrefix (string apiKeyIdentifier) return apiKeyValue; } - private string _tempFolderPath = Path.GetTempPath(); + private string _tempFolderPath; /// /// Gets or sets the temporary folder path to store the files downloaded from the server. @@ -263,7 +244,15 @@ public string GetApiKeyWithPrefix (string apiKeyIdentifier) /// Folder path. public String TempFolderPath { - get { return _tempFolderPath; } + get + { + // default to Path.GetTempPath() if _tempFolderPath is not set + if (String.IsNullOrEmpty(_tempFolderPath)) + { + _tempFolderPath = Path.GetTempPath(); + } + return _tempFolderPath; + } set { @@ -323,14 +312,21 @@ public String DateTimeFormat /// public static String ToDebugReport() { - String report = "C# SDK (Sphereon.SDK.Template.Processor) Debug Report:\n"; + String report = "C# SDK ({{{packageName}}}) Debug Report:\n"; + {{^netStandard}} + {{^supportsUWP}} report += " OS: " + Environment.OSVersion + "\n"; report += " .NET Framework Version: " + Assembly .GetExecutingAssembly() .GetReferencedAssemblies() .Where(x => x.Name == "System.Core").First().Version.ToString() + "\n"; - report += " Version of the API: 0.1\n"; - report += " SDK Package Version: 1.0.0\n"; + {{/supportsUWP}} + {{/netStandard}} + {{#netStandard}} + report += " OS: " + System.Runtime.InteropServices.RuntimeInformation.OSDescription + "\n"; + {{/netStandard}} + report += " Version of the API: {{{version}}}\n"; + report += " SDK Package Version: {{{packageVersion}}}\n"; return report; } diff --git a/src/main/mustacheTemplates/csharp/ExceptionFactory.mustache b/src/main/mustacheTemplates/csharp/ExceptionFactory.mustache new file mode 100644 index 0000000..7b330b7 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/ExceptionFactory.mustache @@ -0,0 +1,20 @@ +{{>partial_header}} + +using System; +{{#netStandard}} +using RestSharp.Portable; +{{/netStandard}} +{{^netStandard}} +using RestSharp; +{{/netStandard}} + +namespace {{packageName}}.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + {{>visibility}} delegate Exception ExceptionFactory(string methodName, IRestResponse response); +} diff --git a/src/main/mustacheTemplates/csharp/FodyWeavers.xml b/src/main/mustacheTemplates/csharp/FodyWeavers.xml new file mode 100644 index 0000000..da017fc --- /dev/null +++ b/src/main/mustacheTemplates/csharp/FodyWeavers.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/mustacheTemplates/csharp/IApiAccessor.mustache b/src/main/mustacheTemplates/csharp/IApiAccessor.mustache new file mode 100644 index 0000000..a3355a1 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/IApiAccessor.mustache @@ -0,0 +1,38 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +{{#netStandard}} +using RestSharp.Portable; +{{/netStandard}} +{{^netStandard}} +using RestSharp; +{{/netStandard}} + +namespace {{packageName}}.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + {{>visibility}} interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + Configuration Configuration {get; set;} + + /// + /// Gets the base path of the API client. + /// + /// The base path + String GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/src/main/mustacheTemplates/csharp/Project.mustache b/src/main/mustacheTemplates/csharp/Project.mustache new file mode 100644 index 0000000..fac3bd2 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/Project.mustache @@ -0,0 +1,120 @@ + + + + + {{#netStandard}}14.0{{/netStandard}} + Debug + AnyCPU + {{packageGuid}} + Library + Properties + {{packageName}} + {{packageName}} + {{#netStandard}} + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {{targetFramework}} + {{/netStandard}} + {{^netStandard}} + {{^supportsUWP}} + {{targetFramework}} + {{/supportsUWP}} + {{#supportsUWP}} + UAP + 10.0.10240.0 + 10.0.10240.0 + 14 + {{/supportsUWP}} + {{/netStandard}} + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + + + ..\..\..\src\main\certificates\{{packageName}}.snk + + + + {{^netStandard}} + + + + + + + + + + + $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + {{binRelativePath}}\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + + + $(SolutionDir)\packages\RestSharpSigned.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll + ..\packages\RestSharpSigned.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll + ..\..\packages\RestSharpSigned.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll + {{binRelativePath}}\RestSharpSigned.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll + + {{#generatePropertyChanged}} + + ..\..\packages\PropertyChanged.Fody.1.51.3\Lib\portable-net4+sl4+wp8+win8+wpa81+MonoAndroid16+MonoTouch40\PropertyChanged.dll + + {{/generatePropertyChanged}} + {{/netStandard}} + {{#netStandard}} + + + {{/netStandard}} + + + + + {{^netStandard}} + + + {{#generatePropertyChanged}} + + {{/generatePropertyChanged}} + + + {{#generatePropertyChanged}} + + {{/generatePropertyChanged}} + {{/netStandard}} + {{#netStandard}} + + + {{/netStandard}} + + diff --git a/src/main/mustacheTemplates/csharp/README.mustache b/src/main/mustacheTemplates/csharp/README.mustache new file mode 100644 index 0000000..80e2437 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/README.mustache @@ -0,0 +1,204 @@ +# {{packageName}} - the C# library for the {{appName}} + +{{#appDescription}} +{{{appDescription}}} +{{/appDescription}} + +This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: {{appVersion}} +- SDK version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + + +## Frameworks supported +{{#netStandard}} +- .NET Core >=1.0 +- .NET Framework >=4.6 +- Mono/Xamarin >=vNext +- UWP >=10.0 +{{/netStandard}} +{{^netStandard}} +{{^supportUWP}} +- .NET 4.0 or later +- Windows Phone 7.1 (Mango) +{{/supportUWP}} +{{#supportUWP}} +- UWP +{{/supportUWP}} +{{/netStandard}} + + +## Dependencies +{{#netStandard}} +- FubarCoder.RestSharp.Portable.Core >=4.0.7 +- FubarCoder.RestSharp.Portable.HttpClient >=4.0.7 +- Newtonsoft.Json >=9.0.1 +{{/netStandard}} +{{^netStandard}} +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.1.0 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later + +The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +Install-Package RestSharp +Install-Package Newtonsoft.Json +``` + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742) +{{/netStandard}} + + +## Installation +{{#netStandard}} +Generate the DLL using your preferred tool +{{/netStandard}} +{{^netStandard}} +Run the following command to generate the DLL +- [Mac/Linux] `/bin/sh build.sh` +- [Windows] `build.bat` +{{/netStandard}} + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; +``` +{{^netStandard}} + +## Packaging + +A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. + +This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: + +``` +nuget pack -Build -OutputDirectory out {{packageName}}.csproj +``` + +Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. + +{{/netStandard}} + +## Getting Started + +```csharp +using System; +using System.Diagnostics; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace Example +{ + public class {{operationId}}Example + { + public void main() + { +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasic}} + // Configure HTTP basic authorization: {{{name}}} + Configuration.Default.Username = "YOUR_USERNAME"; + Configuration.Default.Password = "YOUR_PASSWORD"; + {{/isBasic}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + var apiInstance = new {{classname}}(); + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} + Debug.WriteLine(result);{{/returnType}} + } + catch (Exception e) + { + Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + } +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + + +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} + + +## Documentation for Authorization + +{{^authMethods}} +All endpoints do not require authorization. +{{/authMethods}} +{{#authMethods}} +{{#last}} +Authentication schemes defined for the API: +{{/last}} +{{/authMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} diff --git a/src/main/mustacheTemplates/csharp/Solution.mustache b/src/main/mustacheTemplates/csharp/Solution.mustache new file mode 100644 index 0000000..183dbe2 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/Solution.mustache @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio {{^netStandard}}2012{{/netStandard}}{{#netStandard}}14{{/netStandard}} +VisualStudioVersion = {{^netStandard}}12.0.0.0{{/netStandard}}{{#netStandard}}14.0.25420.1{{/netStandard}} +MinimumVisualStudioVersion = {{^netStandard}}10.0.0.1{{/netStandard}}{{#netStandard}}10.0.40219.1{{/netStandard}} +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "src\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" +EndProject +{{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "src\{{testPackageName}}\{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +{{/excludeTests}}Global +GlobalSection(SolutionConfigurationPlatforms) = preSolution +Debug|Any CPU = Debug|Any CPU +Release|Any CPU = Release|Any CPU +EndGlobalSection +GlobalSection(ProjectConfigurationPlatforms) = postSolution +{{packageGuid}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{{packageGuid}}.Debug|Any CPU.Build.0 = Debug|Any CPU +{{packageGuid}}.Release|Any CPU.ActiveCfg = Release|Any CPU +{{packageGuid}}.Release|Any CPU.Build.0 = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU +{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU +EndGlobalSection +GlobalSection(SolutionProperties) = preSolution +HideSolutionNode = FALSE +EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/src/main/mustacheTemplates/csharp/SwaggerDateConverter.mustache b/src/main/mustacheTemplates/csharp/SwaggerDateConverter.mustache new file mode 100644 index 0000000..4bbf0cb --- /dev/null +++ b/src/main/mustacheTemplates/csharp/SwaggerDateConverter.mustache @@ -0,0 +1,21 @@ +{{>partial_header}} +using Newtonsoft.Json.Converters; + +namespace {{packageName}}.Client +{ + /// + /// Formatter for 'date' swagger formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types + /// + public class SwaggerDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public SwaggerDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/src/main/mustacheTemplates/csharp/TestProject.mustache b/src/main/mustacheTemplates/csharp/TestProject.mustache new file mode 100644 index 0000000..22b8e51 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/TestProject.mustache @@ -0,0 +1,95 @@ + + + + + Debug + AnyCPU + {19F1DEBC-DE5E-4517-8062-F000CD499087} + Library + Properties + {{testPackageName}} + {{testPackageName}} + {{^supportsUWP}} + {{targetFramework}} + {{/supportsUWP}} + {{#supportsUWP}} + UAP + 10.0.10240.0 + 10.0.10240.0 + 14 + {{/supportsUWP}} + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + $(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + {{binRelativePath}}\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll + + + $(SolutionDir)\packages\RestSharpSigned.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll + ..\packages\RestSharpSigned.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll + ..\..\packages\RestSharpSigned.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll + {{binRelativePath}}\RestSharpSigned.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll + + + $(SolutionDir)\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll + ..\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll + ..\..\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll + {{binRelativePath}}\NUnit.3.9.0\lib\nunit.framework.dll + + + + + + + + + + + + {{packageGuid}} + {{packageName}} + + + + diff --git a/src/main/mustacheTemplates/csharp/api.mustache b/src/main/mustacheTemplates/csharp/api.mustache new file mode 100644 index 0000000..a16b99c --- /dev/null +++ b/src/main/mustacheTemplates/csharp/api.mustache @@ -0,0 +1,461 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +{{#netStandard}} +using RestSharp.Portable; +{{/netStandard}} +{{^netStandard}} +using RestSharp; +{{/netStandard}} +using {{packageName}}.Client; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : IApiAccessor + { + #region Synchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{/operation}} + #endregion Synchronous Operations + {{#supportsAsync}} + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{/operation}} + #endregion Asynchronous Operations + {{/supportsAsync}} + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}(String basePath) + { + this.Configuration = new Configuration(new ApiClient(basePath)); + + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + + // ensure API client has configuration ready + if (Configuration.ApiClient.Configuration == null) + { + this.Configuration.ApiClient.Configuration = this.Configuration; + } + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public {{classname}}(Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + + // ensure API client has configuration ready + if (Configuration.ApiClient.Configuration == null) + { + this.Configuration.ApiClient.Configuration = this.Configuration; + } + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public Dictionary DefaultHeader() + { + return this.Configuration.DefaultHeader; + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { + {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + public ApiResponse<{{#returnType}} {{{returnType}}} {{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { + {{#allParams}} + {{#required}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + {{/required}} + {{/allParams}} + + var localVarPath = "{{#netStandard}}.{{/netStandard}}{{{path}}}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + {{#consumes}} + "{{{mediaType}}}"{{#hasMore}}, {{/hasMore}} + {{/consumes}} + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + {{#produces}} + "{{{mediaType}}}"{{#hasMore}},{{/hasMore}} + {{/produces}} + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + {{#pathParams}} + if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter + {{/pathParams}} + {{#queryParams}} + if ({{paramName}} != null) localVarQueryParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // query parameter + {{/queryParams}} + {{#headerParams}} + if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter + {{/headerParams}} + {{#formParams}} + if ({{paramName}} != null) {{#isFile}}localVarFileParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}localVarFormParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}} + {{/formParams}} + {{#bodyParam}} + if ({{paramName}} != null && {{paramName}}.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter + } + else + { + localVarPostBody = {{paramName}}; // byte array + } + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInHeader}} + if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarHeaderParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}"); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarQueryParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}"); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + // http basic authentication required + if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password)) + { + localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password); + } + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!String.IsNullOrEmpty(Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; + }{{/isOAuth}} + {{/authMethods}} + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.{{httpMethod}}, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("{{operationId}}", localVarResponse); + if (exception != null) throw exception; + } + + {{#returnType}} + return new ApiResponse<{{{returnType}}}>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => x.Value.ToString()), + ({{{returnType}}}) Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); + {{/returnType}} + {{^returnType}} + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => x.Value.ToString()), + null); + {{/returnType}} + } + + {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { + {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/returnType}} + + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + public async System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { + {{#allParams}} + {{#required}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + {{/required}} + {{/allParams}} + + var localVarPath = "{{#netStandard}}.{{/netStandard}}{{{path}}}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + {{#consumes}} + "{{{mediaType}}}"{{#hasMore}}, {{/hasMore}} + {{/consumes}} + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + {{#produces}} + "{{{mediaType}}}"{{#hasMore}},{{/hasMore}} + {{/produces}} + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + {{#pathParams}} + if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter + {{/pathParams}} + {{#queryParams}} + if ({{paramName}} != null) localVarQueryParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // query parameter + {{/queryParams}} + {{#headerParams}} + if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter + {{/headerParams}} + {{#formParams}} + if ({{paramName}} != null) {{#isFile}}localVarFileParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}localVarFormParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}} + {{/formParams}} + {{#bodyParam}} + if ({{paramName}} != null && {{paramName}}.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter + } + else + { + localVarPostBody = {{paramName}}; // byte array + } + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInHeader}} + if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarHeaderParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}"); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarQueryParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}"); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + // http basic authentication required + if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password)) + { + localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password); + } + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!String.IsNullOrEmpty(Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; + } + {{/isOAuth}} + {{/authMethods}} + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.{{httpMethod}}, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("{{operationId}}", localVarResponse); + if (exception != null) throw exception; + } + + {{#returnType}} + return new ApiResponse<{{{returnType}}}>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => x.Value.ToString()), + ({{{returnType}}}) Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); + {{/returnType}} + {{^returnType}} + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => x.Value.ToString()), + null); + {{/returnType}} + } + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} diff --git a/src/main/mustacheTemplates/csharp/api_doc.mustache b/src/main/mustacheTemplates/csharp/api_doc.mustache new file mode 100644 index 0000000..ff3cf4f --- /dev/null +++ b/src/main/mustacheTemplates/csharp/api_doc.mustache @@ -0,0 +1,105 @@ +# {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} +{{description}}{{/description}} + +All URIs are relative to *{{{basePath}}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +# **{{{operationId}}}** +> {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + +{{{summary}}}{{#notes}} + +{{{notes}}}{{/notes}} + +### Example +```csharp +using System; +using System.Diagnostics; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace Example +{ + public class {{operationId}}Example + { + public void main() + { + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasic}} + // Configure HTTP basic authorization: {{{name}}} + Configuration.Default.Username = "YOUR_USERNAME"; + Configuration.Default.Password = "YOUR_PASSWORD"; + {{/isBasic}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + var apiInstance = new {{classname}}(); + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{returnType}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} + Debug.WriteLine(result);{{/returnType}} + } + catch (Exception e) + { + Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + } + } + } +} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} + +[[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) + +{{/operation}} +{{/operations}} diff --git a/src/main/mustacheTemplates/csharp/api_test.mustache b/src/main/mustacheTemplates/csharp/api_test.mustache new file mode 100644 index 0000000..0550080 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/api_test.mustache @@ -0,0 +1,75 @@ +{{>partial_header}} +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using {{packageName}}.Client; +using {{packageName}}.{{apiPackage}}; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.Test +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class {{classname}}Tests + { + private {{classname}} instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new {{classname}}(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{operationId}}InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' {{classname}} + //Assert.IsInstanceOfType(typeof({{classname}}), instance, "instance is a {{classname}}"); + } + + {{#operations}}{{#operation}} + /// + /// Test {{operationId}} + /// + [Test] + public void {{operationId}}Test() + { + // TODO uncomment below to test the method and replace null with proper value + {{#allParams}} + //{{{dataType}}} {{paramName}} = null; + {{/allParams}} + //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}//Assert.IsInstanceOf<{{{returnType}}}> (response, "response is {{{returnType}}}");{{/returnType}} + } + {{/operation}}{{/operations}} + } + +} diff --git a/src/main/mustacheTemplates/csharp/compile-mono.sh.mustache b/src/main/mustacheTemplates/csharp/compile-mono.sh.mustache new file mode 100644 index 0000000..bc59059 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/compile-mono.sh.mustache @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +frameworkVersion={{targetFrameworkNuget}} +netfx=${frameworkVersion#net} + +echo "[INFO] Target framework: ${frameworkVersion}" + +echo "[INFO] Download nuget and packages" +wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe; +mozroots --import --sync +mono nuget.exe install src/{{packageName}}/packages.config -o packages; + +echo "[INFO] Copy DLLs to the 'bin' folder" +mkdir -p bin; +cp packages/Newtonsoft.Json.10.0.3/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; +cp packages/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll; +{{#generatePropertyChanged}} +cp packages/Fody.1.29.4/Fody.dll bin/Fody.dll +cp packages/PropertyChanged.Fody.1.51.3/PropertyChanged.Fody.dll bin/PropertyChanged.Fody.dll +cp packages/PropertyChanged.Fody.1.51.3/Lib/dotnet/PropertyChanged.dll bin/PropertyChanged.dll +{{/generatePropertyChanged}} + +echo "[INFO] Run 'mcs' to build bin/{{{packageName}}}.dll" +mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\ +{{#generatePropertyChanged}} +bin/Fody.dll,\ +bin/PropertyChanged.Fody.dll,\ +bin/PropertyChanged.dll,\ +{{/generatePropertyChanged}} +bin/RestSharp.dll,\ +System.ComponentModel.DataAnnotations.dll,\ +System.Runtime.Serialization.dll \ +-target:library \ +-out:bin/{{packageName}}.dll \ +-recurse:'src/{{packageName}}/*.cs' \ +-doc:bin/{{packageName}}.xml \ +-platform:anycpu + +if [ $? -ne 0 ] +then + echo "[ERROR] Compilation failed with exit code $?" + exit 1 +else + echo "[INFO] bin/{{{packageName}}}.dll was created successfully" +fi diff --git a/src/main/mustacheTemplates/csharp/compile.mustache b/src/main/mustacheTemplates/csharp/compile.mustache new file mode 100644 index 0000000..2ef0e06 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/compile.mustache @@ -0,0 +1,26 @@ +:: Generated by: https://github.com/swagger-api/swagger-codegen.git +:: + +@echo off + +{{#supportsAsync}} +SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319 +{{/supportsAsync}} +{{^supportsAsync}} +SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v3.5 +{{/supportsAsync}} + +if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.\nuget.exe')" +.\nuget.exe install src\{{packageName}}\packages.config -o packages + +if not exist ".\bin" mkdir bin + +copy packages\Newtonsoft.Json.10.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll +copy packages\RestSharp.105.1.0\lib\{{targetFrameworkNuget}}\RestSharp.dll bin\RestSharp.dll +{{#generatePropertyChanged}} +copy packages\Fody.1.29.4\Fody.dll bin\Fody.dll +copy packages\PropertyChanged.Fody.1.51.3\PropertyChanged.Fody.dll bin\PropertyChanged.Fody.dll +copy packages\PropertyChanged.Fody.1.51.3\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll +{{/generatePropertyChanged}} +%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml + diff --git a/src/main/mustacheTemplates/csharp/enumClass.mustache b/src/main/mustacheTemplates/csharp/enumClass.mustache new file mode 100644 index 0000000..d8d5d41 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/enumClass.mustache @@ -0,0 +1,17 @@ + /// + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// + {{#description}} + /// {{description}} + {{/description}} + [JsonConverter(typeof(StringEnumConverter))] + {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + { + {{#allowableValues}}{{#enumVars}} + /// + /// Enum {{name}} for {{{value}}} + /// + [EnumMember(Value = {{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isFloat}}"{{/isFloat}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isFloat}}"{{/isFloat}})] + {{name}}{{#isLong}} = {{{value}}}{{/isLong}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}}, + {{/-last}}{{/enumVars}}{{/allowableValues}} + } diff --git a/src/main/mustacheTemplates/csharp/git_push.sh.mustache b/src/main/mustacheTemplates/csharp/git_push.sh.mustache new file mode 100644 index 0000000..a9b0f28 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/git_push.sh.mustache @@ -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="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + 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/src/main/mustacheTemplates/csharp/gitignore.mustache b/src/main/mustacheTemplates/csharp/gitignore.mustache new file mode 100644 index 0000000..d3f4f7b --- /dev/null +++ b/src/main/mustacheTemplates/csharp/gitignore.mustache @@ -0,0 +1,185 @@ +# Ref: https://gist.github.com/kmorcinek/2710267 +# Download this file using PowerShell v3 under Windows with the following comand +# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# OS generated files # +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings +modulesbin/ +tempbin/ + +# EPiServer Site file (VPP) +AppData/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# vim +*.txt~ +*.swp +*.swo + +# svn +.svn + +# SQL Server files +**/App_Data/*.mdf +**/App_Data/*.ldf +**/App_Data/*.sdf + + +#LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store + +# SASS Compiler cache +.sass-cache + +# Visual Studio 2014 CTP +**/*.sln.ide diff --git a/src/main/mustacheTemplates/csharp/model.mustache b/src/main/mustacheTemplates/csharp/model.mustache new file mode 100644 index 0000000..ac36ce6 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/model.mustache @@ -0,0 +1,31 @@ +{{>partial_header}} +using System; +using System.Linq; +using System.IO; +using System.Text; +{{^netStandard}} +using System.Text.RegularExpressions; +{{/netStandard}} +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +{{^netStandard}} +{{#generatePropertyChanged}} +using PropertyChanged; +using System.ComponentModel; +{{/generatePropertyChanged}} +using System.ComponentModel.DataAnnotations; +{{/netStandard}} +using SwaggerDateConverter = {{packageName}}.Client.SwaggerDateConverter; + +{{#models}} +{{#model}} +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}}{{/isEnum}} +{{/model}} +{{/models}} +} diff --git a/src/main/mustacheTemplates/csharp/modelEnum.mustache b/src/main/mustacheTemplates/csharp/modelEnum.mustache new file mode 100644 index 0000000..64e5088 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/modelEnum.mustache @@ -0,0 +1,17 @@ + /// + /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// + {{#description}} + /// {{description}} + {{/description}} + [JsonConverter(typeof(StringEnumConverter))] + {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + { + {{#allowableValues}}{{#enumVars}} + /// + /// Enum {{name}} for {{{value}}} + /// + [EnumMember(Value = {{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}})] + {{name}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}}, + {{/-last}}{{/enumVars}}{{/allowableValues}} + } diff --git a/src/main/mustacheTemplates/csharp/modelGeneric.mustache b/src/main/mustacheTemplates/csharp/modelGeneric.mustache new file mode 100644 index 0000000..a05b84c --- /dev/null +++ b/src/main/mustacheTemplates/csharp/modelGeneric.mustache @@ -0,0 +1,262 @@ + /// + /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// + [DataContract] + {{#generatePropertyChanged}} + [ImplementPropertyChanged] + {{/generatePropertyChanged}} + {{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>{{^netStandard}}{{#validatable}}, IValidatableObject{{/validatable}}{{/netStandard}} + { + {{#vars}} + {{#isEnum}} +{{>modelInnerEnum}} + {{/isEnum}} + {{#items.isEnum}} + {{#items}} +{{>modelInnerEnum}} + {{/items}} + {{/items.isEnum}} + {{/vars}} + {{#vars}} + {{#isEnum}} + /// + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// + {{#description}} + /// {{description}} + {{/description}} + [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})] + public {{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}?{{/isContainer}}{{/isEnum}} {{name}} { get; set; } + {{/isEnum}} + {{/vars}} + {{#hasRequired}} + {{^hasOnlyReadOnly}} + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected {{classname}}() { } + {{/hasOnlyReadOnly}} + {{/hasRequired}} + /// + /// Initializes a new instance of the class. + /// + {{#vars}} + {{^isReadOnly}} + /// {{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}. + {{/isReadOnly}} + {{/vars}} + {{#hasOnlyReadOnly}} + [JsonConstructorAttribute] + {{/hasOnlyReadOnly}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}?{{/isContainer}}{{/isEnum}} {{name}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}?{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}) + { + {{#vars}} + {{^isReadOnly}} + {{#required}} + // to ensure "{{name}}" is required (not null) + if ({{name}} == null) + { + throw new InvalidDataException("{{name}} is a required property for {{classname}} and cannot be null"); + } + else + { + this.{{name}} = {{name}}; + } + {{/required}} + {{/isReadOnly}} + {{/vars}} + {{#vars}} + {{^isReadOnly}} + {{^required}} + {{#defaultValue}}// use default value if no "{{name}}" provided + if ({{name}} == null) + { + this.{{name}} = {{{defaultValue}}}; + } + else + { + this.{{name}} = {{name}}; + } + {{/defaultValue}} + {{^defaultValue}} +this.{{name}} = {{name}}; + {{/defaultValue}} + {{/required}} + {{/isReadOnly}} + {{/vars}} + } + + {{#vars}} + {{^isEnum}} + /// + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{#description}} + /// {{description}}{{/description}} + [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})]{{#isDate}} + [JsonConverter(typeof(SwaggerDateConverter))]{{/isDate}} + public {{{datatype}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + {{/isEnum}} + + {{/vars}} + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + {{#vars}} + sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); + {{/vars}} + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public {{#parent}} new {{/parent}}string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as {{classname}}); + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return {{#vars}}{{#isNotContainer}} + ( + this.{{name}} == other.{{name}} || + this.{{name}} != null && + this.{{name}}.Equals(other.{{name}}) + ){{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{^isNotContainer}} + ( + this.{{name}} == other.{{name}} || + this.{{name}} != null && + this.{{name}}.SequenceEqual(other.{{name}}) + ){{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{/vars}}{{^vars}}false{{/vars}}; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + {{#vars}} + if (this.{{name}} != null) + hash = hash * 59 + this.{{name}}.GetHashCode(); + {{/vars}} + return hash; + } + } +{{^netStandard}} + +{{#generatePropertyChanged}} + /// + /// Property changed event handler + /// + public event PropertyChangedEventHandler PropertyChanged; + + /// + /// Trigger when a property changed + /// + /// Property Name + public virtual void OnPropertyChanged(string propertyName) + { + // NOTE: property changed is handled via "code weaving" using Fody. + // Properties with setters are modified at compile time to notify of changes. + var propertyChanged = PropertyChanged; + if (propertyChanged != null) + { + propertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + +{{/generatePropertyChanged}} +{{#validatable}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + {{#vars}} + {{#hasValidation}} + {{#maxLength}} + // {{{name}}} ({{{datatype}}}) maxLength + if(this.{{{name}}} != null && this.{{{name}}}.Length > {{maxLength}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}" }); + } + + {{/maxLength}} + {{#minLength}} + // {{{name}}} ({{{datatype}}}) minLength + if(this.{{{name}}} != null && this.{{{name}}}.Length < {{minLength}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}" }); + } + + {{/minLength}} + {{#maximum}} + // {{{name}}} ({{{datatype}}}) maximum + if(this.{{{name}}} > ({{{datatype}}}){{maximum}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value less than or equal to {{maximum}}.", new [] { "{{{name}}}" }); + } + + {{/maximum}} + {{#minimum}} + // {{{name}}} ({{{datatype}}}) minimum + if(this.{{{name}}} < ({{{datatype}}}){{minimum}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value greater than or equal to {{minimum}}.", new [] { "{{{name}}}" }); + } + + {{/minimum}} + {{#pattern}} + {{^isByteArray}} + // {{{name}}} ({{{datatype}}}) pattern + Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); + if (false == regex{{{name}}}.Match(this.{{{name}}}).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); + } + + {{/isByteArray}} + {{/pattern}} + {{/hasValidation}} + {{/vars}} + yield break; + } +{{/validatable}} +{{/netStandard}} + } diff --git a/src/main/mustacheTemplates/csharp/modelInnerEnum.mustache b/src/main/mustacheTemplates/csharp/modelInnerEnum.mustache new file mode 100644 index 0000000..7af083a --- /dev/null +++ b/src/main/mustacheTemplates/csharp/modelInnerEnum.mustache @@ -0,0 +1,19 @@ + {{^isContainer}} + /// + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// + {{#description}} + /// {{description}} + {{/description}} + [JsonConverter(typeof(StringEnumConverter))] + {{>visibility}} enum {{#datatypeWithEnum}}{{&.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + { + {{#allowableValues}}{{#enumVars}} + /// + /// Enum {{name}} for {{{value}}} + /// + [EnumMember(Value = {{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isFloat}}"{{/isFloat}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isFloat}}"{{/isFloat}})] + {{name}}{{#isLong}} = {{{value}}}{{/isLong}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}}, + {{/-last}}{{/enumVars}}{{/allowableValues}} + } + {{/isContainer}} diff --git a/src/main/mustacheTemplates/csharp/model_doc.mustache b/src/main/mustacheTemplates/csharp/model_doc.mustache new file mode 100644 index 0000000..112d472 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/model_doc.mustache @@ -0,0 +1,14 @@ +{{#models}} +{{#model}} +# {{{packageName}}}.{{modelPackage}}.{{{classname}}} +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/vars}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +{{/model}} +{{/models}} diff --git a/src/main/mustacheTemplates/csharp/model_test.mustache b/src/main/mustacheTemplates/csharp/model_test.mustache new file mode 100644 index 0000000..f059706 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/model_test.mustache @@ -0,0 +1,75 @@ +{{>partial_header}} + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.{{modelPackage}}; +using {{packageName}}.Client; +using System.Reflection; + +{{#models}} +{{#model}} +namespace {{packageName}}.Test +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class {{classname}}Tests + { + // TODO uncomment below to declare an instance variable for {{classname}} + //private {{classname}} instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of {{classname}} + //instance = new {{classname}}(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{classname}}InstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" {{classname}} + //Assert.IsInstanceOfType<{{classname}}> (instance, "variable 'instance' is a {{classname}}"); + } + + {{#vars}} + /// + /// Test the property '{{name}}' + /// + [Test] + public void {{name}}Test() + { + // TODO unit test for the property '{{name}}' + } + {{/vars}} + + } + +} +{{/model}} +{{/models}} diff --git a/src/main/mustacheTemplates/csharp/mono_nunit_test.mustache b/src/main/mustacheTemplates/csharp/mono_nunit_test.mustache new file mode 100644 index 0000000..f9d2d63 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/mono_nunit_test.mustache @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe +mozroots --import --sync + +echo "[INFO] remove bin/Debug/SwaggerClientTest.dll" +rm src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null + +echo "[INFO] install NUnit runners via NuGet" +wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe +mozroots --import --sync +mono nuget.exe install src/{{{packageName}}}.Test/packages.config -o packages + +echo "[INFO] Install NUnit runners via NuGet" +mono nuget.exe install NUnit.Runners -Version 2.6.4 -OutputDirectory packages + +echo "[INFO] Build the solution and run the unit test" +xbuild {{{packageName}}}.sln && \ + mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll diff --git a/src/main/mustacheTemplates/csharp/netcore_project.mustache b/src/main/mustacheTemplates/csharp/netcore_project.mustache new file mode 100644 index 0000000..85b6fe0 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/netcore_project.mustache @@ -0,0 +1,45 @@ + + + + {{targetFrameworkNuget}} + {{packageName}} + {{packageName}} + Library + {{packageAuthors}} + {{packageCompany}} + {{packageTitle}} + {{packageDescription}} + {{packageCopyright}} + true + true + true + {{packageName}} + {{packageVersion}} + + + + {{#netStandard}} + + + {{/netStandard}} + {{^netStandard}} + + {{/netStandard}} + + + + {{^netStandard}} + + + + + + + + + + + + {{/netStandard}} + + \ No newline at end of file diff --git a/src/main/mustacheTemplates/csharp/netcore_testproject.mustache b/src/main/mustacheTemplates/csharp/netcore_testproject.mustache new file mode 100644 index 0000000..c365a21 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/netcore_testproject.mustache @@ -0,0 +1,48 @@ + + + + {{targetFrameworkNuget}} + {{testPackageName}} + {{testPackageName}} + Library + {{packageAuthors}} + {{packageCompany}} + {{packageTitle}} + {{packageDescription}} + {{packageCopyright}} + true + true + true + {{testPackageName}} + + + + + {{#netStandard}} + + {{/netStandard}} + {{^netStandard}} + + {{/netStandard}} + + + + {{^netStandard}} + + + + + + + + + + + + {{/netStandard}} + + + + + + \ No newline at end of file diff --git a/src/main/mustacheTemplates/csharp/nuspec.mustache b/src/main/mustacheTemplates/csharp/nuspec.mustache new file mode 100644 index 0000000..dc0fdc3 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/nuspec.mustache @@ -0,0 +1,52 @@ + + + + + $id$ + {{packageTitle}} + + + $version$ + + + $author$ + + + $author$ + false + false + + + {{packageDescription}} + {{#termsOfService}} + {{termsOfService}} + {{/termsOfService}} + {{#licenseUrl}} + {{licenseUrl}} + {{/licenseUrl}} + + + + + + + {{#generatePropertyChanged}} + + + {{/generatePropertyChanged}} + + + + + + + + + {{#generatePropertyChanged}} + + {{/generatePropertyChanged}} + + + diff --git a/src/main/mustacheTemplates/csharp/packages.config.mustache b/src/main/mustacheTemplates/csharp/packages.config.mustache new file mode 100644 index 0000000..e98a5aa --- /dev/null +++ b/src/main/mustacheTemplates/csharp/packages.config.mustache @@ -0,0 +1,9 @@ + + + + + {{#generatePropertyChanged}} + + + {{/generatePropertyChanged}} + diff --git a/src/main/mustacheTemplates/csharp/packages_test.config.mustache b/src/main/mustacheTemplates/csharp/packages_test.config.mustache new file mode 100644 index 0000000..cb1d541 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/packages_test.config.mustache @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/main/mustacheTemplates/csharp/partial_header.mustache b/src/main/mustacheTemplates/csharp/partial_header.mustache new file mode 100644 index 0000000..b655ebb --- /dev/null +++ b/src/main/mustacheTemplates/csharp/partial_header.mustache @@ -0,0 +1,13 @@ +/* + {{#appName}} + * {{{appName}}} + * + {{/appName}} + {{#appDescription}} + * {{{appDescription}}} + * + {{/appDescription}} + * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ diff --git a/src/main/mustacheTemplates/csharp/project.json.mustache b/src/main/mustacheTemplates/csharp/project.json.mustache new file mode 100644 index 0000000..0107fc3 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/project.json.mustache @@ -0,0 +1,11 @@ +{ + "supports": {}, + "dependencies": { + "FubarCoder.RestSharp.Portable.Core": "4.0.7", + "FubarCoder.RestSharp.Portable.HttpClient": "4.0.7", + "Newtonsoft.Json": "9.0.1" + }, + "frameworks": { + "{{targetFrameworkNuget}}": {} + } +} \ No newline at end of file diff --git a/src/main/mustacheTemplates/csharp/travis.mustache b/src/main/mustacheTemplates/csharp/travis.mustache new file mode 100644 index 0000000..b26ecc6 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/travis.mustache @@ -0,0 +1,9 @@ +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# +language: csharp +mono: + - latest +solution: {{{packageName}}}.sln +script: + - /bin/sh ./mono_nunit_test.sh diff --git a/src/main/mustacheTemplates/csharp/visibility.mustache b/src/main/mustacheTemplates/csharp/visibility.mustache new file mode 100644 index 0000000..a1d1f41 --- /dev/null +++ b/src/main/mustacheTemplates/csharp/visibility.mustache @@ -0,0 +1 @@ +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} \ No newline at end of file diff --git a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiCallback.java b/src/main/mustacheTemplates/okhttp-gson/ApiCallback.mustache similarity index 54% rename from java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiCallback.java rename to src/main/mustacheTemplates/okhttp-gson/ApiCallback.mustache index cc21b61..4cc99a7 100644 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiCallback.java +++ b/src/main/mustacheTemplates/okhttp-gson/ApiCallback.mustache @@ -1,29 +1,6 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +{{>licenseInfo}} -package com.sphereon.sdk.template.processor.handler; +package {{invokerPackage}}; import java.io.IOException; diff --git a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiClient.java b/src/main/mustacheTemplates/okhttp-gson/ApiClient.mustache similarity index 91% rename from java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiClient.java rename to src/main/mustacheTemplates/okhttp-gson/ApiClient.mustache index 34dc9c7..3d6af17 100644 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ApiClient.java +++ b/src/main/mustacheTemplates/okhttp-gson/ApiClient.mustache @@ -1,29 +1,6 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler; +{{>licenseInfo}} + +package {{invokerPackage}}; import com.squareup.okhttp.Call; import com.squareup.okhttp.Callback; @@ -86,10 +63,10 @@ import okio.BufferedSink; import okio.Okio; -import com.sphereon.sdk.template.processor.handler.auth.Authentication; -import com.sphereon.sdk.template.processor.handler.auth.HttpBasicAuth; -import com.sphereon.sdk.template.processor.handler.auth.ApiKeyAuth; -import com.sphereon.sdk.template.processor.handler.auth.OAuth; +import {{invokerPackage}}.auth.Authentication; +import {{invokerPackage}}.auth.HttpBasicAuth; +import {{invokerPackage}}.auth.ApiKeyAuth; +import {{invokerPackage}}.auth.OAuth; public class ApiClient { public static final double JAVA_VERSION; @@ -124,7 +101,7 @@ public class ApiClient { */ public static final String LENIENT_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; - private String basePath = "https://gw.api.cloud.sphereon.com/"; + private String basePath = "{{{basePath}}}"; private boolean lenientOnJson = false; private boolean debugging = false; private Map defaultHeaderMap = new HashMap(); @@ -139,6 +116,7 @@ public class ApiClient { private InputStream sslCaCert; private boolean verifyingSsl; + private KeyManager[] keyManagers; private OkHttpClient httpClient; private JSON json; @@ -151,6 +129,11 @@ public class ApiClient { public ApiClient() { httpClient = new OkHttpClient(); + {{#useGzipFeature}} + // Enable gzip request compression + httpClient.interceptors().add(new GzipRequestInterceptor()); + {{/useGzipFeature}} + verifyingSsl = true; json = new JSON(this); @@ -169,11 +152,13 @@ public ApiClient() { this.lenientDatetimeFormat = true; // Set default User-Agent. - setUserAgent("Swagger-Codegen/0.1.2-SNAPSHOT/java"); + setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); - authentications.put("oauth2schema", new OAuth()); + authentications = new HashMap();{{#authMethods}}{{#isBasic}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -190,7 +175,7 @@ public String getBasePath() { /** * Set base path * - * @param basePath Base path of the URL (e.g https://gw.api.cloud.sphereon.com/ + * @param basePath Base path of the URL (e.g {{{basePath}}} * @return An instance of OkHttpClient */ public ApiClient setBasePath(String basePath) { @@ -283,6 +268,23 @@ public ApiClient setSslCaCert(InputStream sslCaCert) { 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; } @@ -736,12 +738,13 @@ public String sanitizeFilename(String filename) { * application/json * application/json; charset=UTF8 * APPLICATION/JSON - * + * application/vnd.company+json * @param mime MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ public boolean isJsonMime(String mime) { - return mime != null && mime.matches("(?i)application\\/json(;.*)?"); + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json")); } /** @@ -1022,8 +1025,18 @@ public void onResponse(Response response) throws IOException { } catch (ApiException e) { callback.onFailure(e, response.code(), response.headers().toMultimap()); return; + } catch (Throwable t) { + callback.onFailure(new ApiException("An error occurred whilst reading the API response: " + t.getMessage(), + t, response.code(), response.headers().toMultimap(), response.body().string()), response.code(), response.headers().toMultimap()); + return; + } + try { + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } catch (Throwable t) { + callback.onFailure(new ApiException("An error occurred in the onSuccess callback: " + t.getMessage(), + t, response.code(), response.headers().toMultimap(), response.body().string()), response.code(), response.headers().toMultimap()); + return; } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); } }); } @@ -1043,6 +1056,13 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept 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); @@ -1075,6 +1095,26 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @throws ApiException If fail to serialize the request body object */ public Call buildCall(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Request request = buildRequest(path, method, queryParams, 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 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, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { updateParamsForAuth(authNames, queryParams, headerParams); final String url = buildUrl(path, queryParams); @@ -1115,7 +1155,7 @@ public Call buildCall(String path, String method, List queryParams, Object request = reqBuilder.method(method, reqBody).build(); } - return httpClient.newCall(request); + return request; } /** @@ -1264,7 +1304,6 @@ private void initDatetimeFormat() { */ private void applySslSettings() { try { - KeyManager[] keyManagers = null; TrustManager[] trustManagers = null; HostnameVerifier hostnameVerifier = null; if (!verifyingSsl) { diff --git a/src/main/mustacheTemplates/okhttp-gson/ApiResponse.mustache b/src/main/mustacheTemplates/okhttp-gson/ApiResponse.mustache new file mode 100644 index 0000000..3909393 --- /dev/null +++ b/src/main/mustacheTemplates/okhttp-gson/ApiResponse.mustache @@ -0,0 +1,48 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +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/src/main/mustacheTemplates/okhttp-gson/GzipRequestInterceptor.mustache b/src/main/mustacheTemplates/okhttp-gson/GzipRequestInterceptor.mustache new file mode 100644 index 0000000..23224cf --- /dev/null +++ b/src/main/mustacheTemplates/okhttp-gson/GzipRequestInterceptor.mustache @@ -0,0 +1,70 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +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/java8/src/main/java/com/sphereon/sdk/template/processor/handler/JSON.java b/src/main/mustacheTemplates/okhttp-gson/JSON.mustache similarity index 68% rename from java8/src/main/java/com/sphereon/sdk/template/processor/handler/JSON.java rename to src/main/mustacheTemplates/okhttp-gson/JSON.mustache index 0ec8721..9ce4b33 100644 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/JSON.java +++ b/src/main/mustacheTemplates/okhttp-gson/JSON.mustache @@ -1,41 +1,8 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +{{>licenseInfo}} +package {{invokerPackage}}; -package com.sphereon.sdk.template.processor.handler; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonNull; -import com.google.gson.JsonParseException; -import com.google.gson.JsonPrimitive; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.TypeAdapter; +import com.google.gson.*; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; @@ -43,10 +10,20 @@ import java.io.StringReader; import java.lang.reflect.Type; import java.util.Date; +import java.util.Base64; + +{{^java8}} +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; +{{/java8}} +{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +{{/java8}} public class JSON { private ApiClient apiClient; @@ -61,8 +38,14 @@ public JSON(ApiClient apiClient) { this.apiClient = apiClient; gson = new GsonBuilder() .registerTypeAdapter(Date.class, new DateAdapter(apiClient)) + {{^java8}} + .registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter()) + {{/java8}} + {{#java8}} .registerTypeAdapter(OffsetDateTime.class, new OffsetDateTimeTypeAdapter()) + {{/java8}} .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter()) + .registerTypeHierarchyAdapter(byte[].class, new Base64ToByteArrayTypeAdapter()) .create(); } @@ -99,7 +82,7 @@ public String serialize(Object obj) { * * @param Type * @param body The JSON string - * @param returnType The type to deserialize inot + * @param returnType The type to deserialize into * @return The deserialized Java object */ @SuppressWarnings("unchecked") @@ -161,10 +144,9 @@ public JsonElement serialize(Date src, Type typeOfSrc, JsonSerializationContext * * @param json Json element * @param date Type - * @param typeOfSrc Type * @param context Json Serialization Context * @return Date - * @throw JsonParseException if fail to parse + * @throws JsonParseException if fail to parse */ @Override public Date deserialize(JsonElement json, Type date, JsonDeserializationContext context) throws JsonParseException { @@ -177,6 +159,67 @@ public Date deserialize(JsonElement json, Type date, JsonDeserializationContext } } +{{^java8}} +/** + * Gson TypeAdapter for Joda DateTime type + */ +class DateTimeTypeAdapter extends TypeAdapter { + + private final DateTimeFormatter parseFormatter = ISODateTimeFormat.dateOptionalTimeParser(); + private final DateTimeFormatter printFormatter = ISODateTimeFormat.dateTime(); + + @Override + public void write(JsonWriter out, DateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(printFormatter.print(date)); + } + } + + @Override + public DateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return parseFormatter.parseDateTime(date); + } + } +} + +/** + * Gson TypeAdapter for Joda LocalDate type + */ +class LocalDateTypeAdapter extends TypeAdapter { + + private final DateTimeFormatter formatter = ISODateTimeFormat.date(); + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.print(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return formatter.parseLocalDate(date); + } + } +} +{{/java8}} +{{#java8}} /** * Gson TypeAdapter for jsr310 OffsetDateTime type */ @@ -238,3 +281,12 @@ public LocalDate read(JsonReader in) throws IOException { } } } + + +class Base64ToByteArrayTypeAdapter implements JsonDeserializer { + public byte[] deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { + return Base64.getDecoder().decode(json.getAsString()); + } +} + +{{/java8}} diff --git a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ProgressRequestBody.java b/src/main/mustacheTemplates/okhttp-gson/ProgressRequestBody.mustache similarity index 55% rename from java8/src/main/java/com/sphereon/sdk/template/processor/handler/ProgressRequestBody.java rename to src/main/mustacheTemplates/okhttp-gson/ProgressRequestBody.mustache index f9fd5c4..0f15c1f 100644 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ProgressRequestBody.java +++ b/src/main/mustacheTemplates/okhttp-gson/ProgressRequestBody.mustache @@ -1,29 +1,6 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.sphereon.sdk.template.processor.handler; +{{>licenseInfo}} + +package {{invokerPackage}}; import com.squareup.okhttp.MediaType; import com.squareup.okhttp.RequestBody; @@ -46,8 +23,6 @@ public interface ProgressRequestListener { private final ProgressRequestListener progressListener; - private BufferedSink bufferedSink; - public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) { this.requestBody = requestBody; this.progressListener = progressListener; @@ -65,13 +40,9 @@ public long contentLength() throws IOException { @Override public void writeTo(BufferedSink sink) throws IOException { - if (bufferedSink == null) { - bufferedSink = Okio.buffer(sink(sink)); - } - + BufferedSink bufferedSink = Okio.buffer(sink(sink)); requestBody.writeTo(bufferedSink); bufferedSink.flush(); - } private Sink sink(Sink sink) { diff --git a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ProgressResponseBody.java b/src/main/mustacheTemplates/okhttp-gson/ProgressResponseBody.mustache similarity index 59% rename from java8/src/main/java/com/sphereon/sdk/template/processor/handler/ProgressResponseBody.java rename to src/main/mustacheTemplates/okhttp-gson/ProgressResponseBody.mustache index d6655b8..3f53133 100644 --- a/java8/src/main/java/com/sphereon/sdk/template/processor/handler/ProgressResponseBody.java +++ b/src/main/mustacheTemplates/okhttp-gson/ProgressResponseBody.mustache @@ -1,29 +1,6 @@ -/** - * Template-Processor - * The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.< The flow is generally as follows: Interactive testing: A web based test console is available in the Sphereon API Store - * - * OpenAPI spec version: 0.1 - * Contact: dev@sphereon.com - * - * 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. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +{{>licenseInfo}} - -package com.sphereon.sdk.template.processor.handler; +package {{invokerPackage}}; import com.squareup.okhttp.MediaType; import com.squareup.okhttp.ResponseBody; diff --git a/src/main/mustacheTemplates/okhttp-gson/api.mustache b/src/main/mustacheTemplates/okhttp-gson/api.mustache new file mode 100644 index 0000000..49f9ea0 --- /dev/null +++ b/src/main/mustacheTemplates/okhttp-gson/api.mustache @@ -0,0 +1,228 @@ +{{>licenseInfo}} + +package {{package}}; + +import {{invokerPackage}}.ApiCallback; +import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.ApiException; +import {{invokerPackage}}.ApiResponse; +import {{invokerPackage}}.Configuration; +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ProgressRequestBody; +import {{invokerPackage}}.ProgressResponseBody; +{{#performBeanValidation}} +import {{invokerPackage}}.BeanValidationException; +{{/performBeanValidation}} + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} +{{#performBeanValidation}} +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.ValidatorFactory; +import javax.validation.executable.ExecutableValidator; +import java.util.Set; +import java.lang.reflect.Method; +import java.lang.reflect.Type; +{{/performBeanValidation}} + +{{#imports}}import {{import}}; +{{/imports}} + +import java.lang.reflect.Type; +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}} + +{{#operations}} +public class {{classname}} { + private ApiClient {{localVariablePrefix}}apiClient; + + public {{classname}}() { + this(Configuration.getDefaultApiClient()); + } + + public {{classname}}(ApiClient apiClient) { + this.{{localVariablePrefix}}apiClient = apiClient; + } + + public ApiClient getApiClient() { + return {{localVariablePrefix}}apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.{{localVariablePrefix}}apiClient = apiClient; + } + + {{#operation}} + /** + * Build call for {{operationId}}{{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + * @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 {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + + // create path and map variables + String {{localVariablePrefix}}localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll("\\{" + "{{baseName}}" + "\\}", {{localVariablePrefix}}apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + + {{javaUtilPrefix}}List {{localVariablePrefix}}localVarQueryParams = new {{javaUtilPrefix}}ArrayList();{{#queryParams}} + if ({{paramName}} != null) + {{localVariablePrefix}}localVarQueryParams.addAll({{localVariablePrefix}}apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}));{{/queryParams}} + + {{javaUtilPrefix}}Map {{localVariablePrefix}}localVarHeaderParams = new {{javaUtilPrefix}}HashMap();{{#headerParams}} + if ({{paramName}} != null) + {{localVariablePrefix}}localVarHeaderParams.put("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));{{/headerParams}} + + {{javaUtilPrefix}}Map {{localVariablePrefix}}localVarFormParams = new {{javaUtilPrefix}}HashMap();{{#formParams}} + if ({{paramName}} != null) + {{localVariablePrefix}}localVarFormParams.put("{{baseName}}", {{paramName}});{{/formParams}} + + final String[] {{localVariablePrefix}}localVarAccepts = { + {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} + }; + final String {{localVariablePrefix}}localVarAccept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}localVarAccepts); + if ({{localVariablePrefix}}localVarAccept != null) {{localVariablePrefix}}localVarHeaderParams.put("Accept", {{localVariablePrefix}}localVarAccept); + + final String[] {{localVariablePrefix}}localVarContentTypes = { + {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} + }; + final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes); + {{localVariablePrefix}}localVarHeaderParams.put("Content-Type", {{localVariablePrefix}}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[] {{localVariablePrefix}}localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} }; + return {{localVariablePrefix}}apiClient.buildCall({{localVariablePrefix}}localVarPath, "{{httpMethod}}", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarPostBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + {{^performBeanValidation}} + {{#allParams}}{{#required}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) { + throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)"); + } + {{/required}}{{/allParams}} + + com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener); + return {{localVariablePrefix}}call; + + {{/performBeanValidation}} + {{#performBeanValidation}} + try { + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + ExecutableValidator executableValidator = factory.getValidator().forExecutables(); + + Object[] parameterValues = { {{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}} }; + Method method = this.getClass().getMethod("{{operationId}}WithHttpInfo"{{#allParams}}, {{#isListContainer}}java.util.List{{/isListContainer}}{{#isMapContainer}}java.util.Map{{/isMapContainer}}{{^isListContainer}}{{^isMapContainer}}{{{dataType}}}{{/isMapContainer}}{{/isListContainer}}.class{{/allParams}}); + Set> violations = executableValidator.validateParameters(this, method, + parameterValues); + + if (violations.size() == 0) { + com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener); + return {{localVariablePrefix}}call; + + } else { + throw new BeanValidationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + + {{/performBeanValidation}} + + + + + } + + /** + * {{summary}} + * {{notes}}{{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}} + * @return {{returnType}}{{/returnType}} + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { + {{#returnType}}ApiResponse<{{{returnType}}}> {{localVariablePrefix}}resp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} + return {{localVariablePrefix}}resp.getData();{{/returnType}} + } + + /** + * {{summary}} + * {{notes}}{{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { + com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null, null); + {{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType);{{/returnType}}{{^returnType}}return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call);{{/returnType}} + } + + /** + * {{summary}} (asynchronously) + * {{notes}}{{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + * @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 {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{localVariablePrefix}}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 {{localVariablePrefix}}call = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener); + {{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + {{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType, {{localVariablePrefix}}callback);{{/returnType}}{{^returnType}}{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}callback);{{/returnType}} + return {{localVariablePrefix}}call; + } + {{/operation}} +} +{{/operations}} diff --git a/src/main/mustacheTemplates/okhttp-gson/auth/HttpBasicAuth.mustache b/src/main/mustacheTemplates/okhttp-gson/auth/HttpBasicAuth.mustache new file mode 100644 index 0000000..320903b --- /dev/null +++ b/src/main/mustacheTemplates/okhttp-gson/auth/HttpBasicAuth.mustache @@ -0,0 +1,43 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.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/src/main/mustacheTemplates/okhttp-gson/build.gradle.mustache b/src/main/mustacheTemplates/okhttp-gson/build.gradle.mustache new file mode 100644 index 0000000..0d169cf --- /dev/null +++ b/src/main/mustacheTemplates/okhttp-gson/build.gradle.mustache @@ -0,0 +1,111 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = '{{groupId}}' +version = '{{artifactVersion}}' + +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 { + {{#java8}} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + {{/java8}} + } + + // 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_{{^java8}}1_7{{/java8}}{{#java8}}1_8{{/java8}} + targetCompatibility = JavaVersion.VERSION_{{^java8}}1_7{{/java8}}{{#java8}}1_8{{/java8}} + + install { + repositories.mavenInstaller { + pom.artifactId = '{{artifactId}}' + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +dependencies { + compile 'io.swagger:swagger-annotations:1.5.15' + 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' + {{^java8}} + compile 'joda-time:joda-time:2.9.9' + {{/java8}} + testCompile 'junit:junit:4.12' +} diff --git a/src/main/mustacheTemplates/okhttp-gson/build.sbt.mustache b/src/main/mustacheTemplates/okhttp-gson/build.sbt.mustache new file mode 100644 index 0000000..c2eef2e --- /dev/null +++ b/src/main/mustacheTemplates/okhttp-gson/build.sbt.mustache @@ -0,0 +1,22 @@ +lazy val root = (project in file(".")). + settings( + organization := "{{groupId}}", + name := "{{artifactId}}", + version := "{{artifactVersion}}", + 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" % "swagger-annotations" % "1.5.15", + "com.squareup.okhttp" % "okhttp" % "2.7.5", + "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", + "com.google.code.gson" % "gson" % "2.8.1", + {{^java8}} + "joda-time" % "joda-time" % "2.9.9" % "compile", + {{/java8}} + "junit" % "junit" % "4.12" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/src/main/mustacheTemplates/okhttp-gson/pom.mustache b/src/main/mustacheTemplates/okhttp-gson/pom.mustache new file mode 100644 index 0000000..aa6b574 --- /dev/null +++ b/src/main/mustacheTemplates/okhttp-gson/pom.mustache @@ -0,0 +1,264 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + {{artifactUrl}} + {{artifactDescription}} + + {{scmConnection}} + {{scmDeveloperConnection}} + {{scmUrl}} + + + 2.2.0 + + + + + {{licenseName}} + {{licenseUrl}} + repo + + + + + + {{developerName}} + {{developerEmail}} + {{developerOrganization}} + {{developerOrganizationUrl}} + + + + + + + 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 + swagger-annotations + ${swagger-core-version} + + + com.squareup.okhttp + okhttp + ${okhttp-version} + + + + com.squareup.okio + okio + ${okio.version} + + + com.squareup.okhttp + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + {{^java8}} + + joda-time + joda-time + ${jodatime-version} + + {{/java8}} + {{#useBeanValidation}} + + + javax.validation + validation-api + 1.1.0.Final + provided + + {{/useBeanValidation}} + {{#performBeanValidation}} + + + org.hibernate + hibernate-validator + 5.4.1.Final + + + javax.el + el-api + 2.2 + + {{/performBeanValidation}} + {{#parcelableModel}} + + + com.google.android + android + 4.1.1.4 + provided + + {{/parcelableModel}} + + + junit + junit + ${junit-version} + test + + + com.sphereon.public + authentication-lib-main + ${authentication-lib.version} + test + + + + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + ${java.version} + ${java.version} + 1.5.15 + 2.7.5 + 1.13.0 + 2.8.1 + 2.9.9 + 1.0.0 + 4.12 + UTF-8 + 0.1.4-SNAPSHOT + + diff --git a/src/main/resources/config/csharp-net35.json b/src/main/resources/config/csharp-net35.json new file mode 100644 index 0000000..0ef80a0 --- /dev/null +++ b/src/main/resources/config/csharp-net35.json @@ -0,0 +1,35 @@ +{ + "lang": "csharp", + "packageTitle": "PDF SDK C# .net35", + "inputSpec": "swagger.json", + "outputDir": "csharp-net35", + "verbose": true, + "skipOverwrite": false, + "templateDir": "src/main/resources", + "auth": "hello:world", + "apiPackage": "Sphereon.SDK.Pdf.Api", + "modelPackage": "Sphereon.SDK.Pdf.Model", + "invokerPackage": "Sphereon.SDK.Pdf.Invoker", + "groupId": "com.sphereon.sdk", + "artifactId": "pdf-sdk-csharp-net35", + "artifactVersion": "0.1.5-SNAPSHOT", + "systemProperties": { + "systemProp1": "value1" + }, + "instantiationTypes": { + "hello": "world" + }, + "typeMappings": { + "foo": "bar" + }, + "additionalProperties": { + "addtProp1": "value2" + }, + "importMappings": { + "type1": "import1" + }, + "languageSpecificPrimitives": [ + "rolex" + ], + "localVariablePrefix": "_" +} diff --git a/src/main/resources/config/csharp-net45.json b/src/main/resources/config/csharp-net45.json index d980ee6..fbda4cb 100644 --- a/src/main/resources/config/csharp-net45.json +++ b/src/main/resources/config/csharp-net45.json @@ -1,18 +1,18 @@ { "lang": "csharp", - "packageTitle": "OFFICE-TEXT SDK C# .net45", + "packageTitle": "PDF SDK C# .net45", "inputSpec": "swagger.json", "outputDir": "csharp-net45", "verbose": true, "skipOverwrite": false, "templateDir": "src/main/resources", "auth": "hello:world", - "apiPackage": "Sphereon.SDK.OFFICE-TEXT.Api", - "modelPackage": "Sphereon.SDK.OFFICE-TEXT.Model", - "invokerPackage": "Sphereon.SDK.OFFICE-TEXT.Invoker", + "apiPackage": "Sphereon.SDK.Pdf.Api", + "modelPackage": "Sphereon.SDK.Pdf.Model", + "invokerPackage": "Sphereon.SDK.Pdf.Invoker", "groupId": "com.sphereon.sdk", - "artifactId": "office-text-sdk-csharp-net45", - "artifactVersion": "0.0.1-SNAPSHOT", + "artifactId": "pdf-sdk-csharp-net45", + "artifactVersion": "0.1.5-SNAPSHOT", "systemProperties": { "systemProp1": "value1" }, diff --git a/swagger.sdk.json b/swagger.sdk.json index 51b0ca9..3663527 100644 --- a/swagger.sdk.json +++ b/swagger.sdk.json @@ -1,94 +1,83 @@ { - "basePath": "/", + "basePath": "/template/processor/0.1", "paths": { - "/template/processor/0.1/jobs": { - "get": { - "summary": "Get all jobs", + "/templates": { + "post": { + "summary": "Create template context", "security": [{"oauth2schema": ["global"]}], "produces": ["application/json;charset=UTF-8"], - "description": "Get all office text job definitions and their current state.", - "operationId": "getJobs", - "responses": {"200": { - "schema": { - "type": "array", - "items": {"$ref": "#/definitions/MergeJobResponse"} + "description": "Create a unique template context for your environment", + "operationId": "createTemplateContext", + "responses": { + "200": { + "schema": {"$ref": "#/definitions/TemplateContextResponse"}, + "description": "Template context created" }, - "description": "All office text jobs that have not been deleted" - }}, + "400": { + "schema": {"$ref": "#/definitions/ErrorResponse"}, + "description": "Template context already exists" + } + }, "parameters": [{ - "in": "query", - "name": "status", - "description": "A list of status to filter on.", - "type": "array", - "items": { - "type": "string", - "enum": [ - "CREATED", - "UPDATED", - "PROCESSING", - "DONE", - "ERROR", - "DELETED" - ] - }, - "collectionFormat": "multi", - "required": false, - "enum": [ - "CREATED", - "UPDATED", - "PROCESSING", - "DONE", - "ERROR", - "DELETED" - ] + "schema": {"$ref": "#/definitions/TemplateContextRequest"}, + "in": "body", + "name": "templateRequest", + "description": "The template request", + "required": true }], "tags": [ - "Job", + "Template", "All" ], - "consumes": ["application/json"] + "consumes": ["application/json;charset=UTF-8"] }, "put": { - "summary": "Submit merge job for processing", + "summary": "Update template context", "security": [{"oauth2schema": ["global"]}], "produces": ["application/json;charset=UTF-8"], - "description": "Submit merge job run.", - "operationId": "submitJob", - "responses": {"200": { - "schema": {"$ref": "#/definitions/MergeJobResponse"}, - "description": "Merge job submitted" - }}, + "description": "Update an existing template context for your environment", + "operationId": "updateTemplateContext", + "responses": { + "200": { + "schema": {"$ref": "#/definitions/TemplateContextResponse"}, + "description": "Template context updated" + }, + "500": { + "schema": {"$ref": "#/definitions/ErrorResponse"}, + "description": "Internal server error" + }, + "404": { + "schema": {"$ref": "#/definitions/ErrorResponse"}, + "description": "Template context not found" + } + }, "parameters": [{ - "schema": {"$ref": "#/definitions/MergeSettings"}, + "schema": {"$ref": "#/definitions/TemplateContext"}, "in": "body", - "name": "mergesettings", - "description": "The merge- and output settings", + "name": "templateContext", + "description": "templateContext", "required": true }], "tags": [ - "Job", + "Template", "All" ], "consumes": ["application/json;charset=UTF-8"] } }, - "/template/processor/0.1/jobs/{jobId}/result/container": {"put": { + "/jobs/{jobId}/result/stream": {"put": { "summary": "Get the result file", "security": [{"oauth2schema": ["global"]}], "produces": ["application/octet-stream"], - "description": "Get all documents inside a compressed container as a binary stream.\r\n ", - "operationId": "getResultStreamsAsContainer", + "description": "Get a merge result document as a binary stream.\r\n ", + "operationId": "getResultStream", "responses": { "200": { "schema": { "format": "byte", "type": "string" }, - "description": "Result package successfully created and returned" - }, - "400": { - "schema": {"$ref": "#/definitions/ErrorResponse"}, - "description": "Result file could not be created." + "description": "Result file successfully returned" }, "202": { "schema": { @@ -96,6 +85,10 @@ "type": "string" }, "description": "Result file not yet created. Job is still executing." + }, + "400": { + "schema": {"$ref": "#/definitions/ErrorResponse"}, + "description": "Result file could not be created." } }, "parameters": [ @@ -107,11 +100,11 @@ "required": true }, { - "schema": {"$ref": "#/definitions/OutputSettings"}, + "schema": {"$ref": "#/definitions/ResultStreamRequest"}, "in": "body", - "name": "outputSettings", - "description": "outputSettings", - "required": false + "name": "resultStreamRequest", + "description": "resultStreamRequest", + "required": true } ], "tags": [ @@ -120,7 +113,7 @@ ], "consumes": ["application/json;charset=UTF-8"] }}, - "/template/processor/0.1/jobs/{jobId}": { + "/jobs/{jobId}": { "get": { "summary": "Job definition and state", "security": [{"oauth2schema": ["global"]}], @@ -185,116 +178,19 @@ "consumes": ["application/json"] } }, - "/template/processor/0.1/templates": { - "post": { - "summary": "Create template context", - "security": [{"oauth2schema": ["global"]}], - "produces": ["application/json;charset=UTF-8"], - "description": "Create a unique template context for your environment", - "operationId": "createTemplateContext", - "responses": { - "200": { - "schema": {"$ref": "#/definitions/TemplateContextResponse"}, - "description": "Template context created" - }, - "400": { - "schema": {"$ref": "#/definitions/ErrorResponse"}, - "description": "Template context already exists" - } - }, - "parameters": [{ - "schema": {"$ref": "#/definitions/TemplateContextRequest"}, - "in": "body", - "name": "templateRequest", - "description": "The template request", - "required": true - }], - "tags": [ - "Template", - "All" - ], - "consumes": ["application/json;charset=UTF-8"] - }, - "put": { - "summary": "Update template context", - "security": [{"oauth2schema": ["global"]}], - "produces": ["application/json;charset=UTF-8"], - "description": "Update an existing template context for your environment", - "operationId": "updateTemplateContext", - "responses": { - "200": { - "schema": {"$ref": "#/definitions/TemplateContextResponse"}, - "description": "Template context updated" - }, - "500": { - "schema": {"$ref": "#/definitions/ErrorResponse"}, - "description": "Internal server error" - }, - "404": { - "schema": {"$ref": "#/definitions/ErrorResponse"}, - "description": "Template context not found" - } - }, - "parameters": [{ - "schema": {"$ref": "#/definitions/TemplateContextRequest"}, - "in": "body", - "name": "templateContextRequest", - "description": "templateContextRequest", - "required": true - }], - "tags": [ - "Template", - "All" - ], - "consumes": ["application/json;charset=UTF-8"] - } - }, - "/template/processor/0.1/datasets": {"post": { - "summary": "Store dataset", - "security": [{"oauth2schema": ["global"]}], - "produces": ["application/json;charset=UTF-8"], - "description": "Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job.", - "operationId": "createDataSet", - "responses": { - "200": { - "schema": {"$ref": "#/definitions/DataSetResponse"}, - "description": "Data set received and stored" - }, - "400": { - "schema": {"$ref": "#/definitions/ErrorResponse"}, - "description": "Unsupported data set format" - } - }, - "parameters": [{ - "schema": {"type": "string"}, - "in": "body", - "name": "payload", - "description": "The dates for the merge\n[\n {\n \"Field1\": \"Field1 value\",\n \"Field2\": \"Field2 value\",\n },\n {\n \"Field1\": \"Field1 value\",\n \"Field2\": \"Field2 value\",\n }\n]", - "required": true - }], - "tags": [ - "DataSet", - "All" - ], - "consumes": ["application/json;charset=UTF-8"] - }}, - "/template/processor/0.1/jobs/{jobId}/result/file/{streamId}": {"put": { + "/jobs/{jobId}/result/container": {"put": { "summary": "Get the result file", "security": [{"oauth2schema": ["global"]}], "produces": ["application/octet-stream"], - "description": "Get a merge result document as a binary stream.\r\n ", - "operationId": "getResultStreamById", + "description": "Get all documents inside a compressed container as a binary stream.\r\n ", + "operationId": "getResultStreamsAsContainer", "responses": { "200": { "schema": { "format": "byte", "type": "string" }, - "description": "Result file successfully returned" - }, - "400": { - "schema": {"$ref": "#/definitions/ErrorResponse"}, - "description": "Result file could not be created." + "description": "Result package successfully created and returned" }, "202": { "schema": { @@ -302,6 +198,10 @@ "type": "string" }, "description": "Result file not yet created. Job is still executing." + }, + "400": { + "schema": {"$ref": "#/definitions/ErrorResponse"}, + "description": "Result file could not be created." } }, "parameters": [ @@ -312,13 +212,6 @@ "type": "string", "required": true }, - { - "in": "path", - "name": "streamId", - "description": "streamId", - "type": "string", - "required": true - }, { "schema": {"$ref": "#/definitions/OutputSettings"}, "in": "body", @@ -333,7 +226,7 @@ ], "consumes": ["application/json;charset=UTF-8"] }}, - "/template/processor/0.1/templates/{templateId}": { + "/templates/{templateId}": { "post": { "summary": "Upload template file", "security": [{"oauth2schema": ["global"]}], @@ -443,7 +336,107 @@ "consumes": ["application/json"] } }, - "/template/processor/0.1/datasets/{dataSetId}": {"delete": { + "/datasets": {"post": { + "summary": "Store dataset", + "security": [{"oauth2schema": ["global"]}], + "produces": ["application/json;charset=UTF-8"], + "description": "Upload and store a data set. Currently only JSON is supported. This call returns an id which can be specified when submitting a merge job.", + "operationId": "createDataSet", + "responses": { + "200": { + "schema": {"$ref": "#/definitions/DataSetResponse"}, + "description": "Data set received and stored" + }, + "400": { + "schema": {"$ref": "#/definitions/ErrorResponse"}, + "description": "Unsupported data set format" + } + }, + "parameters": [{ + "schema": {"type": "string"}, + "in": "body", + "name": "payload", + "description": "The dates for the merge\n[\n {\n \"Field1\": \"Field1 value\",\n \"Field2\": \"Field2 value\",\n },\n {\n \"Field1\": \"Field1 value\",\n \"Field2\": \"Field2 value\",\n }\n]", + "required": true + }], + "tags": [ + "DataSet", + "All" + ], + "consumes": ["application/json;charset=UTF-8"] + }}, + "/jobs": { + "get": { + "summary": "Get all jobs", + "security": [{"oauth2schema": ["global"]}], + "produces": ["application/json;charset=UTF-8"], + "description": "Get all office text job definitions and their current state.", + "operationId": "getJobs", + "responses": {"200": { + "schema": { + "type": "array", + "items": {"$ref": "#/definitions/MergeJobResponse"} + }, + "description": "All office text jobs that have not been deleted" + }}, + "parameters": [{ + "in": "query", + "name": "status", + "description": "A list of status to filter on.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "CREATED", + "UPDATED", + "PROCESSING", + "DONE", + "ERROR", + "DELETED" + ] + }, + "collectionFormat": "multi", + "required": false, + "enum": [ + "CREATED", + "UPDATED", + "PROCESSING", + "DONE", + "ERROR", + "DELETED" + ] + }], + "tags": [ + "Job", + "All" + ], + "consumes": ["application/json"] + }, + "put": { + "summary": "Submit merge job for processing", + "security": [{"oauth2schema": ["global"]}], + "produces": ["application/json;charset=UTF-8"], + "description": "Submit merge job run.", + "operationId": "submitJob", + "responses": {"200": { + "schema": {"$ref": "#/definitions/MergeJobResponse"}, + "description": "Merge job submitted" + }}, + "parameters": [{ + "schema": {"$ref": "#/definitions/MergeSettings"}, + "in": "body", + "name": "mergesettings", + "description": "The merge- and output settings", + "required": true + }], + "tags": [ + "Job", + "All" + ], + "consumes": ["application/json;charset=UTF-8"] + } + }, + "/datasets/{dataSetId}": {"delete": { "summary": "Delete a stored data set", "security": [{"oauth2schema": ["global"]}], "produces": ["application/json;charset=UTF-8"], @@ -571,9 +564,14 @@ "type": "object", "properties": { "folderPath": {"type": "string"}, - "originalFileName": {"type": "string"}, + "fileName": {"type": "string"}, + "filename": {"type": "string"}, + "id": { + "readOnly": true, + "type": "string" + }, "containerId": {"type": "string"}, - "fileId": {"type": "string"} + "originalFilename": {"type": "string"} } }, "TemplateContext": { @@ -587,6 +585,7 @@ "FREEMARKER" ] }, + "claimParameters": {"$ref": "#/definitions/ClaimParameters"}, "templateFileLocations": { "description": "The template files (versioned)", "additionalProperties": {"$ref": "#/definitions/StreamLocation"}, @@ -597,6 +596,10 @@ "type": "string" }, "ownerInfo": {"$ref": "#/definitions/OwnerInfo"}, + "storageLocation": { + "description": "The storage location. (optional)", + "$ref": "#/definitions/StorageLocation" + }, "id": {"type": "string"}, "templateId": { "description": "The template context id", @@ -604,6 +607,16 @@ } } }, + "ClaimParameters": { + "type": "object", + "properties": { + "apiEndUser": {"type": "string"}, + "applicationId": {"type": "string"}, + "keyType": {"type": "string"}, + "sphereonIdentifier": {"type": "string"}, + "apiSupplierTenantId": {"type": "string"} + } + }, "ErrorResponse": { "description": "The error response", "type": "object", @@ -612,58 +625,6 @@ "items": {"$ref": "#/definitions/Error"} }} }, - "TemplateContextResponse": { - "description": "The merge template response.", - "type": "object", - "required": [ - "id", - "status" - ], - "properties": { - "creationTime": { - "format": "date-time", - "description": "The creation date/time of this response in ISO 8601 format", - "readOnly": true, - "type": "string" - }, - "context": {"$ref": "#/definitions/TemplateContext"}, - "id": { - "description": "Unique template context id", - "type": "string" - }, - "status": { - "description": "The status of the template", - "readOnly": true, - "type": "string", - "enum": [ - "CREATED", - "UPDATED", - "DELETED", - "PROCESSING" - ] - } - } - }, - "TemplateContextRequest": { - "description": "The merge template request.", - "type": "object", - "required": ["templateType"], - "properties": { - "templateType": { - "type": "string", - "enum": [ - "OFFICE", - "FREEMARKER" - ] - }, - "description": {"type": "string"}, - "ownerInfo": {"$ref": "#/definitions/OwnerInfo"}, - "templateId": { - "description": "The template context id", - "type": "string" - } - } - }, "OutputSettings": { "description": "Output settings", "type": "object", @@ -699,6 +660,58 @@ } } }, + "TemplateContextRequest": { + "description": "The merge template request.", + "type": "object", + "required": ["template type"], + "properties": { + "description": {"type": "string"}, + "ownerInfo": {"$ref": "#/definitions/OwnerInfo"}, + "templateId": { + "description": "The template context id", + "type": "string" + }, + "template type": { + "type": "string", + "enum": [ + "OFFICE", + "FREEMARKER" + ] + } + } + }, + "TemplateContextResponse": { + "description": "The merge template response.", + "type": "object", + "required": [ + "id", + "status" + ], + "properties": { + "creationTime": { + "format": "date-time", + "description": "The creation date/time of this response in ISO 8601 format", + "readOnly": true, + "type": "string" + }, + "context": {"$ref": "#/definitions/TemplateContext"}, + "id": { + "description": "Unique template context id", + "type": "string" + }, + "status": { + "description": "The status of the template", + "readOnly": true, + "type": "string", + "enum": [ + "CREATED", + "UPDATED", + "DELETED", + "PROCESSING" + ] + } + } + }, "MergeJob": { "description": "The merge job. Has access to the job merge data.", "type": "object", @@ -708,10 +721,6 @@ "status" ], "properties": { - "resultFolderPath": { - "description": "The target folder path of result files", - "type": "string" - }, "completionTime": { "format": "date-time", "description": "The completion date/time of this job in ISO 8601 format", @@ -722,10 +731,7 @@ "description": "The server generated job jobId. This jobId is checked against the jobId in the request path on every invocation", "type": "string" }, - "resultContainerId": { - "description": "The target container id of result files", - "type": "string" - }, + "settings": {"$ref": "#/definitions/MergeSettings"}, "creationTime": { "format": "date-time", "description": "The creation date/time of this job in ISO 8601 format", @@ -747,7 +753,10 @@ "type": "array", "items": {"type": "string"} }, - "mergeSettings": {"$ref": "#/definitions/MergeSettings"}, + "resultStorageLocation": { + "description": "The storage location. (optional)", + "$ref": "#/definitions/StorageLocation" + }, "statusMessage": { "description": "A status message, which can be informational, warning or error. A message here does not indicate an error perse", "readOnly": true, @@ -768,25 +777,18 @@ } } }, - "OwnerInfo": { - "description": "Owner info", + "ResultStreamRequest": { + "description": "A request to download a specific result stream.", "type": "object", + "required": ["streamLocation"], "properties": { - "phone": { - "description": "The owner's phone number", - "type": "string" - }, - "companyDepartment": { - "description": "The owner's company/department", - "type": "string" - }, - "name": { - "description": "The owner's name", - "type": "string" + "streamLocation": { + "description": "The stream location", + "$ref": "#/definitions/StreamLocation" }, - "email": { - "description": "The owner's email address", - "type": "string" + "outputSettings": { + "description": "The Output settings", + "$ref": "#/definitions/OutputSettings" } } }, @@ -796,7 +798,7 @@ "required": [ "dataSetId", "outputSettings", - "resultStreamLocation", + "resultStorageLocation", "templateId" ], "properties": { @@ -824,15 +826,15 @@ "type": "array", "items": {"type": "string"} }, + "resultStorageLocation": { + "description": "The output location of the result files.", + "$ref": "#/definitions/StorageLocation" + }, "templateVersion": { "format": "int32", "description": "Template version", "type": "integer" }, - "resultStreamLocation": { - "description": "The output location of the result files.", - "$ref": "#/definitions/StreamLocation" - }, "templateId": { "description": "Template id", "type": "string" @@ -840,6 +842,40 @@ "outputSettings": {"$ref": "#/definitions/OutputSettings"} } }, + "OwnerInfo": { + "description": "Owner info", + "type": "object", + "properties": { + "phone": { + "description": "The owner's phone number", + "type": "string" + }, + "companyDepartment": { + "description": "The owner's company/department", + "type": "string" + }, + "name": { + "description": "The owner's name", + "type": "string" + }, + "email": { + "description": "The owner's email address", + "type": "string" + } + } + }, + "StorageLocation": { + "description": "Storage Location", + "type": "object", + "properties": { + "folderPath": {"type": "string"}, + "id": { + "readOnly": true, + "type": "string" + }, + "containerId": {"type": "string"} + } + }, "MergeJobResponse": { "description": "The merge job response.", "type": "object", @@ -886,7 +922,7 @@ "email": "dev@sphereon.com" }, "description": "The Template-Processor API can generate office, xml and json documents from a template and a JSON data file. Supported templates are MS Office files and freemarker files.<<\/b>\r\n\r\nThe flow is generally as follows:\r\n\r\n\r\nInteractive testing: <\/b>A web based test console is available in the Sphereon API Store<\/a>", - "termsOfService": "https://sphereon.com", + "termsOfService": "https://docs.sphereon.com/api/blockchain-proof/0.1/html", "title": "Template-Processor", "version": "0.1" }, @@ -895,14 +931,14 @@ "name": "All", "description": "All APIs combined" }, - { - "name": "Template", - "description": "Templates" - }, { "name": "DataSet", "description": "Dataset related APIs" }, + { + "name": "Template", + "description": "Template APIs" + }, { "name": "Job", "description": "Job APIs"