Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 106 additions & 94 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,135 +1,138 @@
# Org.OpenAPITools - the C# library for the Static OpenAPI document of Push API resource
# databox

Static OpenAPI document of Push API resource
- API version: 0.3.15-sdk.5
- Build date: 2024-07-09T19:29:27.814676Z[Etc/UTC]
- Generator version: 7.6.0

Push API resources Open API documentation

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

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

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

<a id="dependencies"></a>
## Dependencies
## Requirements

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

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
Install-Package System.ComponentModel.Annotations
## Installation

To install the API client library to your local Maven repository, simply execute:

```shell
mvn clean install
```

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).
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).
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

<a id="installation"></a>
## 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 Org.OpenAPITools.org.databox.api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
```shell
mvn clean deploy
```
<a id="packaging"></a>
## 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.
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.

### Maven users

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

```xml
<dependency>
<groupId>org.databox</groupId>
<artifactId>databox</artifactId>
<version>0.1.2</version>
<scope>compile</scope>
</dependency>
```
nuget pack -Build -OutputDirectory out Org.OpenAPITools.csproj

### Gradle users

Add this dependency to your project's build file:

```groovy
repositories {
mavenCentral() // Needed if the 'databox' jar has been published to maven central.
mavenLocal() // Needed if the 'databox' jar has been published to the local maven repo.
}

dependencies {
implementation "org.databox:databox:0.1.2"
}
```

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.
### Others

<a id="usage"></a>
## Usage
At first generate the JAR by executing:

To use the API client with a HTTP proxy, setup a `System.Net.WebProxy`
```csharp
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
```shell
mvn clean package
```

<a id="getting-started"></a>
Then manually install the following JARs:

* `target/databox-0.1.2.jar`
* `target/lib/*.jar`

## Getting Started

```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.org.databox.api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
public class Example
{
public static void Main()
{

Configuration config = new Configuration();
config.BasePath = "https://push.databox.com";
// Configure HTTP basic authorization: basicAuth
config.Username = "YOUR_USERNAME";
config.Password = "YOUR_PASSWORD";

var apiInstance = new DefaultApi(config);

try
{
apiInstance.DataDelete();
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.DataDelete: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}

}
Please follow the [installation](#installation) instruction and execute the following Java code:

```java

// Import classes:
import org.databox.ApiClient;
import org.databox.ApiException;
import org.databox.Configuration;
import org.databox.auth.*;
import org.databox.models.*;
import org.databox.api.DefaultApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://push.databox.com");

// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");

DefaultApi apiInstance = new DefaultApi(defaultClient);
try {
apiInstance.dataDelete();
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#dataDelete");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

```

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

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**DataDelete**](docs/DefaultApi.md#datadelete) | **DELETE** /data |
*DefaultApi* | [**DataMetricKeyDelete**](docs/DefaultApi.md#datametrickeydelete) | **DELETE** /data/{metricKey} |
*DefaultApi* | [**DataPost**](docs/DefaultApi.md#datapost) | **POST** /data |
*DefaultApi* | [**MetrickeysGet**](docs/DefaultApi.md#metrickeysget) | **GET** /metrickeys |
*DefaultApi* | [**MetrickeysPost**](docs/DefaultApi.md#metrickeyspost) | **POST** /metrickeys |
*DefaultApi* | [**PingGet**](docs/DefaultApi.md#pingget) | **GET** /ping |
*DefaultApi* | [**dataDelete**](docs/DefaultApi.md#dataDelete) | **DELETE** /data |
*DefaultApi* | [**dataMetricKeyDelete**](docs/DefaultApi.md#dataMetricKeyDelete) | **DELETE** /data/{metricKey} |
*DefaultApi* | [**dataPost**](docs/DefaultApi.md#dataPost) | **POST** /data |
*DefaultApi* | [**metrickeysGet**](docs/DefaultApi.md#metrickeysGet) | **GET** /metrickeys |
*DefaultApi* | [**metrickeysPost**](docs/DefaultApi.md#metrickeysPost) | **POST** /metrickeys |
*DefaultApi* | [**pingGet**](docs/DefaultApi.md#pingGet) | **GET** /ping |


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

- [Model.ApiResponse](docs/ApiResponse.md)
- [Model.PushData](docs/PushData.md)
- [Model.PushDataAttribute](docs/PushDataAttribute.md)
- [Model.State](docs/State.md)
- [ModelApiResponse](docs/ModelApiResponse.md)
- [PushData](docs/PushData.md)
- [PushDataAttribute](docs/PushDataAttribute.md)
- [State](docs/State.md)


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

- **Type**: HTTP basic authentication


## Recommendation

It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.

## Author



30 changes: 30 additions & 0 deletions src/.github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
#
# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech)

name: Java CI with Maven

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
build:
name: Build Static OpenAPI document of Push API resource
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17, 21 ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --no-transfer-progress --file pom.xml
Loading