Skip to content

Commit 6ad4221

Browse files
authored
Merge pull request #12 from databox/release/0.3.15-sdk.5/1720553349612
[SDK release] Generated SDK code based on data-link 0.3.15-sdk.5 API changes
2 parents a2635c5 + 95e7cbb commit 6ad4221

82 files changed

Lines changed: 6695 additions & 6058 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 106 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,135 +1,138 @@
1-
# Org.OpenAPITools - the C# library for the Static OpenAPI document of Push API resource
1+
# databox
2+
3+
Static OpenAPI document of Push API resource
4+
- API version: 0.3.15-sdk.5
5+
- Build date: 2024-07-09T19:29:27.814676Z[Etc/UTC]
6+
- Generator version: 7.6.0
27

38
Push API resources Open API documentation
49

5-
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
610

7-
- API version: 0.3.15-sdk.5
8-
- SDK version: 1.0.0
9-
- Generator version: 7.6.0
10-
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
11+
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
1112

12-
<a id="frameworks-supported"></a>
13-
## Frameworks supported
1413

15-
<a id="dependencies"></a>
16-
## Dependencies
14+
## Requirements
1715

18-
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later
19-
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later
20-
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later
21-
- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later
16+
Building the API client library requires:
17+
1. Java 1.8+
18+
2. Maven (3.8.3+)/Gradle (7.2+)
2219

23-
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:
24-
```
25-
Install-Package RestSharp
26-
Install-Package Newtonsoft.Json
27-
Install-Package JsonSubTypes
28-
Install-Package System.ComponentModel.Annotations
20+
## Installation
21+
22+
To install the API client library to your local Maven repository, simply execute:
23+
24+
```shell
25+
mvn clean install
2926
```
3027

31-
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).
32-
NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406).
28+
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
3329

34-
<a id="installation"></a>
35-
## Installation
36-
Run the following command to generate the DLL
37-
- [Mac/Linux] `/bin/sh build.sh`
38-
- [Windows] `build.bat`
39-
40-
Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces:
41-
```csharp
42-
using Org.OpenAPITools.org.databox.api;
43-
using Org.OpenAPITools.Client;
44-
using Org.OpenAPITools.Model;
30+
```shell
31+
mvn clean deploy
4532
```
46-
<a id="packaging"></a>
47-
## Packaging
4833

49-
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.
34+
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
35+
36+
### Maven users
5037

51-
This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly:
38+
Add this dependency to your project's POM:
5239

40+
```xml
41+
<dependency>
42+
<groupId>org.databox</groupId>
43+
<artifactId>databox</artifactId>
44+
<version>0.1.2</version>
45+
<scope>compile</scope>
46+
</dependency>
5347
```
54-
nuget pack -Build -OutputDirectory out Org.OpenAPITools.csproj
48+
49+
### Gradle users
50+
51+
Add this dependency to your project's build file:
52+
53+
```groovy
54+
repositories {
55+
mavenCentral() // Needed if the 'databox' jar has been published to maven central.
56+
mavenLocal() // Needed if the 'databox' jar has been published to the local maven repo.
57+
}
58+
59+
dependencies {
60+
implementation "org.databox:databox:0.1.2"
61+
}
5562
```
5663

57-
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.
64+
### Others
5865

59-
<a id="usage"></a>
60-
## Usage
66+
At first generate the JAR by executing:
6167

62-
To use the API client with a HTTP proxy, setup a `System.Net.WebProxy`
63-
```csharp
64-
Configuration c = new Configuration();
65-
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
66-
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
67-
c.Proxy = webProxy;
68+
```shell
69+
mvn clean package
6870
```
6971

70-
<a id="getting-started"></a>
72+
Then manually install the following JARs:
73+
74+
* `target/databox-0.1.2.jar`
75+
* `target/lib/*.jar`
76+
7177
## Getting Started
7278

73-
```csharp
74-
using System.Collections.Generic;
75-
using System.Diagnostics;
76-
using Org.OpenAPITools.org.databox.api;
77-
using Org.OpenAPITools.Client;
78-
using Org.OpenAPITools.Model;
79-
80-
namespace Example
81-
{
82-
public class Example
83-
{
84-
public static void Main()
85-
{
86-
87-
Configuration config = new Configuration();
88-
config.BasePath = "https://push.databox.com";
89-
// Configure HTTP basic authorization: basicAuth
90-
config.Username = "YOUR_USERNAME";
91-
config.Password = "YOUR_PASSWORD";
92-
93-
var apiInstance = new DefaultApi(config);
94-
95-
try
96-
{
97-
apiInstance.DataDelete();
98-
}
99-
catch (ApiException e)
100-
{
101-
Debug.Print("Exception when calling DefaultApi.DataDelete: " + e.Message );
102-
Debug.Print("Status Code: "+ e.ErrorCode);
103-
Debug.Print(e.StackTrace);
104-
}
105-
106-
}
79+
Please follow the [installation](#installation) instruction and execute the following Java code:
80+
81+
```java
82+
83+
// Import classes:
84+
import org.databox.ApiClient;
85+
import org.databox.ApiException;
86+
import org.databox.Configuration;
87+
import org.databox.auth.*;
88+
import org.databox.models.*;
89+
import org.databox.api.DefaultApi;
90+
91+
public class Example {
92+
public static void main(String[] args) {
93+
ApiClient defaultClient = Configuration.getDefaultApiClient();
94+
defaultClient.setBasePath("https://push.databox.com");
95+
96+
// Configure HTTP basic authorization: basicAuth
97+
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
98+
basicAuth.setUsername("YOUR USERNAME");
99+
basicAuth.setPassword("YOUR PASSWORD");
100+
101+
DefaultApi apiInstance = new DefaultApi(defaultClient);
102+
try {
103+
apiInstance.dataDelete();
104+
} catch (ApiException e) {
105+
System.err.println("Exception when calling DefaultApi#dataDelete");
106+
System.err.println("Status code: " + e.getCode());
107+
System.err.println("Reason: " + e.getResponseBody());
108+
System.err.println("Response headers: " + e.getResponseHeaders());
109+
e.printStackTrace();
107110
}
111+
}
108112
}
113+
109114
```
110115

111-
<a id="documentation-for-api-endpoints"></a>
112116
## Documentation for API Endpoints
113117

114118
All URIs are relative to *https://push.databox.com*
115119

116120
Class | Method | HTTP request | Description
117121
------------ | ------------- | ------------- | -------------
118-
*DefaultApi* | [**DataDelete**](docs/DefaultApi.md#datadelete) | **DELETE** /data |
119-
*DefaultApi* | [**DataMetricKeyDelete**](docs/DefaultApi.md#datametrickeydelete) | **DELETE** /data/{metricKey} |
120-
*DefaultApi* | [**DataPost**](docs/DefaultApi.md#datapost) | **POST** /data |
121-
*DefaultApi* | [**MetrickeysGet**](docs/DefaultApi.md#metrickeysget) | **GET** /metrickeys |
122-
*DefaultApi* | [**MetrickeysPost**](docs/DefaultApi.md#metrickeyspost) | **POST** /metrickeys |
123-
*DefaultApi* | [**PingGet**](docs/DefaultApi.md#pingget) | **GET** /ping |
122+
*DefaultApi* | [**dataDelete**](docs/DefaultApi.md#dataDelete) | **DELETE** /data |
123+
*DefaultApi* | [**dataMetricKeyDelete**](docs/DefaultApi.md#dataMetricKeyDelete) | **DELETE** /data/{metricKey} |
124+
*DefaultApi* | [**dataPost**](docs/DefaultApi.md#dataPost) | **POST** /data |
125+
*DefaultApi* | [**metrickeysGet**](docs/DefaultApi.md#metrickeysGet) | **GET** /metrickeys |
126+
*DefaultApi* | [**metrickeysPost**](docs/DefaultApi.md#metrickeysPost) | **POST** /metrickeys |
127+
*DefaultApi* | [**pingGet**](docs/DefaultApi.md#pingGet) | **GET** /ping |
124128

125129

126-
<a id="documentation-for-models"></a>
127130
## Documentation for Models
128131

129-
- [Model.ApiResponse](docs/ApiResponse.md)
130-
- [Model.PushData](docs/PushData.md)
131-
- [Model.PushDataAttribute](docs/PushDataAttribute.md)
132-
- [Model.State](docs/State.md)
132+
- [ModelApiResponse](docs/ModelApiResponse.md)
133+
- [PushData](docs/PushData.md)
134+
- [PushDataAttribute](docs/PushDataAttribute.md)
135+
- [State](docs/State.md)
133136

134137

135138
<a id="documentation-for-authorization"></a>
@@ -142,3 +145,12 @@ Authentication schemes defined for the API:
142145

143146
- **Type**: HTTP basic authentication
144147

148+
149+
## Recommendation
150+
151+
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
152+
153+
## Author
154+
155+
156+

src/.github/workflows/maven.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
#
4+
# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech)
5+
6+
name: Java CI with Maven
7+
8+
on:
9+
push:
10+
branches: [ main, master ]
11+
pull_request:
12+
branches: [ main, master ]
13+
14+
jobs:
15+
build:
16+
name: Build Static OpenAPI document of Push API resource
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
java: [ 17, 21 ]
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up JDK
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: ${{ matrix.java }}
27+
distribution: 'temurin'
28+
cache: maven
29+
- name: Build with Maven
30+
run: mvn -B package --no-transfer-progress --file pom.xml

0 commit comments

Comments
 (0)