Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK release] Generated SDK code based on data-link 0.4.1 API changes #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Push API resources Open API documentation

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

- API version: 1.0
- SDK version: 0.0.2
- API version: 0.4.1
- SDK version: 0.0.3
- Generator version: 7.6.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen

Expand Down Expand Up @@ -107,20 +107,23 @@ namespace Example
{

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

// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new DefaultApi(httpClient, config, httpClientHandler);
var payloadModel = new PayloadModel?(); // PayloadModel? | (optional)

try
{
apiInstance.RootPost(payloadModel);
apiInstance.DataDelete();
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.RootPost: " + e.Message );
Debug.Print("Exception when calling DefaultApi.DataDelete: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand All @@ -133,19 +136,25 @@ namespace Example
<a id="documentation-for-api-endpoints"></a>
## Documentation for API Endpoints

All URIs are relative to *http://localhost:8080/q/openapi*
All URIs are relative to *https://push.databox.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**RootPost**](docs/DefaultApi.md#rootpost) | **POST** / |
*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.PayloadDataModel](docs/PayloadDataModel.md)
- [Model.PayloadModel](docs/PayloadModel.md)
- [Model.PushData](docs/PushData.md)
- [Model.PushDataAttribute](docs/PushDataAttribute.md)
- [Model.State](docs/State.md)


<a id="documentation-for-authorization"></a>
Expand Down
15 changes: 9 additions & 6 deletions src/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ api/openapi.yaml
appveyor.yml
docs/ApiResponse.md
docs/DefaultApi.md
docs/PayloadDataModel.md
docs/PayloadModel.md
docs/PushData.md
docs/PushDataAttribute.md
docs/State.md
git_push.sh
src/Databox.Test/Api/DefaultApiTests.cs
src/Databox.Test/Databox.Test.csproj
src/Databox.Test/Model/ApiResponseTests.cs
src/Databox.Test/Model/PayloadDataModelTests.cs
src/Databox.Test/Model/PayloadModelTests.cs
src/Databox.Test/Model/PushDataAttributeTests.cs
src/Databox.Test/Model/PushDataTests.cs
src/Databox.Test/Model/StateTests.cs
src/Databox/Api/DefaultApi.cs
src/Databox/Client/ApiClient.cs
src/Databox/Client/ApiException.cs
Expand All @@ -34,5 +36,6 @@ src/Databox/Client/WebRequestPathBuilder.cs
src/Databox/Databox.csproj
src/Databox/Model/AbstractOpenAPISchema.cs
src/Databox/Model/ApiResponse.cs
src/Databox/Model/PayloadDataModel.cs
src/Databox/Model/PayloadModel.cs
src/Databox/Model/PushData.cs
src/Databox/Model/PushDataAttribute.cs
src/Databox/Model/State.cs
10 changes: 5 additions & 5 deletions src/Databox.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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}") = "Databox", "src\Databox\Databox.csproj", "{0DEDE14F-8852-43F9-AC99-C5304C96F2C5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Databox", "src\Databox\Databox.csproj", "{59F11C31-8CE7-4450-BD54-A6620CD38DB8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Databox.Test", "src\Databox.Test\Databox.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
EndProject
Expand All @@ -12,10 +12,10 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0DEDE14F-8852-43F9-AC99-C5304C96F2C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0DEDE14F-8852-43F9-AC99-C5304C96F2C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0DEDE14F-8852-43F9-AC99-C5304C96F2C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0DEDE14F-8852-43F9-AC99-C5304C96F2C5}.Release|Any CPU.Build.0 = Release|Any CPU
{59F11C31-8CE7-4450-BD54-A6620CD38DB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59F11C31-8CE7-4450-BD54-A6620CD38DB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59F11C31-8CE7-4450-BD54-A6620CD38DB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59F11C31-8CE7-4450-BD54-A6620CD38DB8}.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
Expand Down
29 changes: 19 additions & 10 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Push API resources Open API documentation

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

- API version: 1.0
- SDK version: 0.0.2
- API version: 0.4.1
- SDK version: 0.0.3
- Generator version: 7.6.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen

Expand Down Expand Up @@ -107,20 +107,23 @@ namespace Example
{

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

// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new DefaultApi(httpClient, config, httpClientHandler);
var payloadModel = new PayloadModel?(); // PayloadModel? | (optional)

try
{
apiInstance.RootPost(payloadModel);
apiInstance.DataDelete();
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.RootPost: " + e.Message );
Debug.Print("Exception when calling DefaultApi.DataDelete: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand All @@ -133,19 +136,25 @@ namespace Example
<a id="documentation-for-api-endpoints"></a>
## Documentation for API Endpoints

All URIs are relative to *http://localhost:8080/q/openapi*
All URIs are relative to *https://push.databox.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**RootPost**](docs/DefaultApi.md#rootpost) | **POST** / |
*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.PayloadDataModel](docs/PayloadDataModel.md)
- [Model.PayloadModel](docs/PayloadModel.md)
- [Model.PushData](docs/PushData.md)
- [Model.PushDataAttribute](docs/PushDataAttribute.md)
- [Model.State](docs/State.md)


<a id="documentation-for-authorization"></a>
Expand Down
152 changes: 90 additions & 62 deletions src/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,125 @@ openapi: 3.0.3
info:
description: Push API resources Open API documentation
title: Static OpenAPI document of Push API resource
version: "1.0"
version: 0.4.1
servers:
- description: Dev mode server description
url: http://localhost:8080/q/openapi
url: https://push.databox.com
security:
- basicAuth: []
paths:
/:
/metrickeys:
get:
responses:
"200":
description: OK
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PayloadModel'
type: object
application/vnd.databox.v2+json:
schema:
type: object
responses:
"200":
description: OK
/ping:
get:
responses:
"200":
description: OK
/data:
delete:
responses:
"200":
description: OK
post:
requestBody:
content:
application/json:
schema:
items:
$ref: '#/components/schemas/PushData'
type: array
application/vnd.databox.v2+json:
schema:
items:
$ref: '#/components/schemas/PushData'
type: array
responses:
"200":
description: OK
/data/{metricKey}:
delete:
parameters:
- explode: false
in: path
name: metricKey
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
example:
status: OK
message: ""
description: OK
"400":
content:
application/json:
example:
status: Bad Request
message: Bad request - Exceeded request count limit!
description: Bad Request
"401":
content:
application/json:
example:
status: Unauthorized
message: Unauthorized - Invalid token!
description: Unauthorized
"500":
content:
application/json:
example:
status: Internal Server Error
message: An unhandled exception occurred while processing your request!
description: Internal Server Error
components:
schemas:
PayloadModel:
ApiResponse:
properties:
status:
type: string
message:
type: string
type: object
PushData:
example:
data:
- $<metric_name>: 123.4
date: 2021-03-01 00:00:00
<dimension_name>: Organic
unit: USD
- $<metric_name>: 123.4
periodFrom: 2021-03-01 00:00:00
periodTo: 2021-03-16 00:00:00
<dimension_name>: Organic
unit: USD
date: date
periodTo: periodTo
unit: unit
periodFrom: periodFrom
attributes:
- value: value
key: key
- value: value
key: key
value: 0.8008282
key: key
properties:
data:
attributes:
items:
$ref: '#/components/schemas/PayloadDataModel'
$ref: '#/components/schemas/PushDataAttribute'
type: array
type: object
PayloadDataModel:
properties:
$<metric_name>:
description: example metric name would be '$sales'
type: number
<dimension_name>:
description: example dimension would be 'channel'
date:
type: string
unit:
key:
type: string
periodFrom:
description: required if date not provided
type: string
periodTo:
description: required if date not provided
type: string
date:
description: required periods not provided
unit:
type: string
required:
- "$<metric_name>,"
- date
value:
format: float
type: number
type: object
ApiResponse:
PushDataAttribute:
example:
value: value
key: key
properties:
status:
key:
type: string
message:
value:
type: string
type: object
State:
enum:
- DOWN
- UP
type: string
securitySchemes:
basicAuth:
scheme: basic
Expand Down
Loading