Skip to content

Commit 501d29a

Browse files
committed
Auto-generate wrapper from updated spec
1 parent 7a0d2f6 commit 501d29a

17 files changed

Lines changed: 1080 additions & 0 deletions

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ Class | Method | HTTP request | Description
132132
*BuiltByBitApi.AnalyticsApi* | [**getV2Analytics**](docs/AnalyticsApi.md#getV2Analytics) | **GET** /v2/analytics | Fetch a list of analytics definitions
133133
*BuiltByBitApi.AnalyticsApi* | [**getV2AnalyticsGraph**](docs/AnalyticsApi.md#getV2AnalyticsGraph) | **GET** /v2/analytics/graph | Fetch analytics graph data
134134
*BuiltByBitApi.AnalyticsApi* | [**getV2AnalyticsSingle**](docs/AnalyticsApi.md#getV2AnalyticsSingle) | **GET** /v2/analytics/single | Fetch a single analytics value
135+
*BuiltByBitApi.DeploymentsApi* | [**postV2DeploymentsUpgrade**](docs/DeploymentsApi.md#postV2DeploymentsUpgrade) | **POST** /v2/deployments/upgrade | Upgrade a short-lived token
135136
*BuiltByBitApi.EventsApi* | [**getV2Events**](docs/EventsApi.md#getV2Events) | **GET** /v2/events | Fetch a list of pending events
136137
*BuiltByBitApi.EventsApi* | [**postV2EventsComplete**](docs/EventsApi.md#postV2EventsComplete) | **POST** /v2/events/complete | Mark events as complete
137138
*BuiltByBitApi.HealthApi* | [**getV2Health**](docs/HealthApi.md#getV2Health) | **GET** /v2/health | Retrieve a health status
@@ -248,6 +249,10 @@ Class | Method | HTTP request | Description
248249
- [BuiltByBitApi.License](docs/License.md)
249250
- [BuiltByBitApi.ListStats](docs/ListStats.md)
250251
- [BuiltByBitApi.Member](docs/Member.md)
252+
- [BuiltByBitApi.PostV2DeploymentsUpgrade200Response](docs/PostV2DeploymentsUpgrade200Response.md)
253+
- [BuiltByBitApi.PostV2DeploymentsUpgrade200ResponseData](docs/PostV2DeploymentsUpgrade200ResponseData.md)
254+
- [BuiltByBitApi.PostV2DeploymentsUpgrade200ResponseDataPreauthorize](docs/PostV2DeploymentsUpgrade200ResponseDataPreauthorize.md)
255+
- [BuiltByBitApi.PostV2DeploymentsUpgradeRequest](docs/PostV2DeploymentsUpgradeRequest.md)
251256
- [BuiltByBitApi.PostV2EventsComplete200Response](docs/PostV2EventsComplete200Response.md)
252257
- [BuiltByBitApi.PostV2EventsCompleteRequest](docs/PostV2EventsCompleteRequest.md)
253258
- [BuiltByBitApi.PostV2ResourcesCreatorBatch200Response](docs/PostV2ResourcesCreatorBatch200Response.md)

docs/DeploymentsApi.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# BuiltByBitApi.DeploymentsApi
2+
3+
All URIs are relative to *https://api.builtbybit.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**postV2DeploymentsUpgrade**](DeploymentsApi.md#postV2DeploymentsUpgrade) | **POST** /v2/deployments/upgrade | Upgrade a short-lived token
8+
9+
10+
11+
## postV2DeploymentsUpgrade
12+
13+
> PostV2DeploymentsUpgrade200Response postV2DeploymentsUpgrade(opts)
14+
15+
Upgrade a short-lived token
16+
17+
18+
19+
### Example
20+
21+
```javascript
22+
import BuiltByBitApi from 'built_by_bit_api';
23+
let defaultClient = BuiltByBitApi.ApiClient.instance;
24+
// Configure API key authorization: token
25+
let token = defaultClient.authentications['token'];
26+
token.apiKey = 'YOUR API KEY';
27+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
28+
//token.apiKeyPrefix = 'Token';
29+
30+
let apiInstance = new BuiltByBitApi.DeploymentsApi();
31+
let opts = {
32+
'postV2DeploymentsUpgradeRequest': new BuiltByBitApi.PostV2DeploymentsUpgradeRequest() // PostV2DeploymentsUpgradeRequest |
33+
};
34+
apiInstance.postV2DeploymentsUpgrade(opts, (error, data, response) => {
35+
if (error) {
36+
console.error(error);
37+
} else {
38+
console.log('API called successfully. Returned data: ' + data);
39+
}
40+
});
41+
```
42+
43+
### Parameters
44+
45+
46+
Name | Type | Description | Notes
47+
------------- | ------------- | ------------- | -------------
48+
**postV2DeploymentsUpgradeRequest** | [**PostV2DeploymentsUpgradeRequest**](PostV2DeploymentsUpgradeRequest.md)| | [optional]
49+
50+
### Return type
51+
52+
[**PostV2DeploymentsUpgrade200Response**](PostV2DeploymentsUpgrade200Response.md)
53+
54+
### Authorization
55+
56+
[token](../README.md#token)
57+
58+
### HTTP request headers
59+
60+
- **Content-Type**: application/json
61+
- **Accept**: application/json
62+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# BuiltByBitApi.PostV2DeploymentsUpgrade200Response
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**result** | **String** | | [optional]
8+
**data** | [**PostV2DeploymentsUpgrade200ResponseData**](PostV2DeploymentsUpgrade200ResponseData.md) | | [optional]
9+
10+
11+
12+
## Enum: ResultEnum
13+
14+
15+
* `success` (value: `"success"`)
16+
17+
18+
19+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# BuiltByBitApi.PostV2DeploymentsUpgrade200ResponseData
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**token** | **String** | | [optional]
8+
**oauth2Client** | **String** | | [optional]
9+
**oauth2Secret** | **String** | | [optional]
10+
**preauthorize** | [**PostV2DeploymentsUpgrade200ResponseDataPreauthorize**](PostV2DeploymentsUpgrade200ResponseDataPreauthorize.md) | | [optional]
11+
12+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# BuiltByBitApi.PostV2DeploymentsUpgrade200ResponseDataPreauthorize
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**accessToken** | **String** | | [optional]
8+
**expiresIn** | **Number** | | [optional]
9+
**refreshToken** | **String** | | [optional]
10+
**scope** | **String** | | [optional]
11+
**tokenType** | **String** | | [optional]
12+
13+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# BuiltByBitApi.PostV2DeploymentsUpgradeRequest
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**preauthorize** | **Boolean** | Whether or not to pre-authorize OAuth2 credentials for the deployment token owner. | [optional] [default to false]
8+
**scopes** | **String** | A space-separated list of scopes to request if pre-authorizing. | [optional]
9+
10+

src/api/DeploymentsApi.js

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/**
2+
* BuiltByBit API
3+
* All operations not tagged 'free' require an active [Ultimate](https://builtbybit.com/account/ultimate) subscription or invite-only permissions. V2 documentation: https://builtbybit.com/wiki/api-v2/ \\ OAuth2 documentation: https://builtbybit.com/wiki/oauth2/
4+
*
5+
* The version of the OpenAPI document: v2
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*
12+
*/
13+
14+
15+
import ApiClient from "../ApiClient";
16+
import PostV2DeploymentsUpgrade200Response from '../model/PostV2DeploymentsUpgrade200Response';
17+
import PostV2DeploymentsUpgradeRequest from '../model/PostV2DeploymentsUpgradeRequest';
18+
19+
/**
20+
* Deployments service.
21+
* @module api/DeploymentsApi
22+
* @version v2
23+
*/
24+
export default class DeploymentsApi {
25+
26+
/**
27+
* Constructs a new DeploymentsApi.
28+
* @alias module:api/DeploymentsApi
29+
* @class
30+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
31+
* default to {@link module:ApiClient#instance} if unspecified.
32+
*/
33+
constructor(apiClient) {
34+
this.apiClient = apiClient || ApiClient.instance;
35+
}
36+
37+
38+
/**
39+
* Callback function to receive the result of the postV2DeploymentsUpgrade operation.
40+
* @callback module:api/DeploymentsApi~postV2DeploymentsUpgradeCallback
41+
* @param {String} error Error message, if any.
42+
* @param {module:model/PostV2DeploymentsUpgrade200Response} data The data returned by the service call.
43+
* @param {String} response The complete HTTP response.
44+
*/
45+
46+
/**
47+
* Upgrade a short-lived token
48+
*
49+
* @param {Object} opts Optional parameters
50+
* @param {module:model/PostV2DeploymentsUpgradeRequest} [postV2DeploymentsUpgradeRequest]
51+
* @param {module:api/DeploymentsApi~postV2DeploymentsUpgradeCallback} callback The callback function, accepting three arguments: error, data, response
52+
* data is of type: {@link module:model/PostV2DeploymentsUpgrade200Response}
53+
*/
54+
postV2DeploymentsUpgrade(opts, callback) {
55+
opts = opts || {};
56+
let postBody = opts['postV2DeploymentsUpgradeRequest'];
57+
58+
let pathParams = {
59+
};
60+
let queryParams = {
61+
};
62+
let headerParams = {
63+
};
64+
let formParams = {
65+
};
66+
67+
let authNames = ['token'];
68+
let contentTypes = ['application/json'];
69+
let accepts = ['application/json'];
70+
let returnType = PostV2DeploymentsUpgrade200Response;
71+
return this.apiClient.callApi(
72+
'/v2/deployments/upgrade', 'POST',
73+
pathParams, queryParams, headerParams, formParams, postBody,
74+
authNames, contentTypes, accepts, returnType, null, callback
75+
);
76+
}
77+
78+
79+
}

src/index.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ import GetV2ResourcesDiscoverLicenses200ResponseData from './model/GetV2Resource
8787
import License from './model/License';
8888
import ListStats from './model/ListStats';
8989
import Member from './model/Member';
90+
import PostV2DeploymentsUpgrade200Response from './model/PostV2DeploymentsUpgrade200Response';
91+
import PostV2DeploymentsUpgrade200ResponseData from './model/PostV2DeploymentsUpgrade200ResponseData';
92+
import PostV2DeploymentsUpgrade200ResponseDataPreauthorize from './model/PostV2DeploymentsUpgrade200ResponseDataPreauthorize';
93+
import PostV2DeploymentsUpgradeRequest from './model/PostV2DeploymentsUpgradeRequest';
9094
import PostV2EventsComplete200Response from './model/PostV2EventsComplete200Response';
9195
import PostV2EventsCompleteRequest from './model/PostV2EventsCompleteRequest';
9296
import PostV2ResourcesCreatorBatch200Response from './model/PostV2ResourcesCreatorBatch200Response';
@@ -122,6 +126,7 @@ import Store from './model/Store';
122126
import Update from './model/Update';
123127
import Version from './model/Version';
124128
import AnalyticsApi from './api/AnalyticsApi';
129+
import DeploymentsApi from './api/DeploymentsApi';
125130
import EventsApi from './api/EventsApi';
126131
import HealthApi from './api/HealthApi';
127132
import Oauth2Api from './api/Oauth2Api';
@@ -615,6 +620,30 @@ export {
615620
*/
616621
Member,
617622

623+
/**
624+
* The PostV2DeploymentsUpgrade200Response model constructor.
625+
* @property {module:model/PostV2DeploymentsUpgrade200Response}
626+
*/
627+
PostV2DeploymentsUpgrade200Response,
628+
629+
/**
630+
* The PostV2DeploymentsUpgrade200ResponseData model constructor.
631+
* @property {module:model/PostV2DeploymentsUpgrade200ResponseData}
632+
*/
633+
PostV2DeploymentsUpgrade200ResponseData,
634+
635+
/**
636+
* The PostV2DeploymentsUpgrade200ResponseDataPreauthorize model constructor.
637+
* @property {module:model/PostV2DeploymentsUpgrade200ResponseDataPreauthorize}
638+
*/
639+
PostV2DeploymentsUpgrade200ResponseDataPreauthorize,
640+
641+
/**
642+
* The PostV2DeploymentsUpgradeRequest model constructor.
643+
* @property {module:model/PostV2DeploymentsUpgradeRequest}
644+
*/
645+
PostV2DeploymentsUpgradeRequest,
646+
618647
/**
619648
* The PostV2EventsComplete200Response model constructor.
620649
* @property {module:model/PostV2EventsComplete200Response}
@@ -825,6 +854,12 @@ export {
825854
*/
826855
AnalyticsApi,
827856

857+
/**
858+
* The DeploymentsApi service constructor.
859+
* @property {module:api/DeploymentsApi}
860+
*/
861+
DeploymentsApi,
862+
828863
/**
829864
* The EventsApi service constructor.
830865
* @property {module:api/EventsApi}
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/**
2+
* BuiltByBit API
3+
* All operations not tagged 'free' require an active [Ultimate](https://builtbybit.com/account/ultimate) subscription or invite-only permissions. V2 documentation: https://builtbybit.com/wiki/api-v2/ \\ OAuth2 documentation: https://builtbybit.com/wiki/oauth2/
4+
*
5+
* The version of the OpenAPI document: v2
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*
12+
*/
13+
14+
import ApiClient from '../ApiClient';
15+
import PostV2DeploymentsUpgrade200ResponseData from './PostV2DeploymentsUpgrade200ResponseData';
16+
17+
/**
18+
* The PostV2DeploymentsUpgrade200Response model module.
19+
* @module model/PostV2DeploymentsUpgrade200Response
20+
* @version v2
21+
*/
22+
class PostV2DeploymentsUpgrade200Response {
23+
/**
24+
* Constructs a new <code>PostV2DeploymentsUpgrade200Response</code>.
25+
* @alias module:model/PostV2DeploymentsUpgrade200Response
26+
*/
27+
constructor() {
28+
29+
PostV2DeploymentsUpgrade200Response.initialize(this);
30+
}
31+
32+
/**
33+
* Initializes the fields of this object.
34+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
35+
* Only for internal use.
36+
*/
37+
static initialize(obj) {
38+
}
39+
40+
/**
41+
* Constructs a <code>PostV2DeploymentsUpgrade200Response</code> from a plain JavaScript object, optionally creating a new instance.
42+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
43+
* @param {Object} data The plain JavaScript object bearing properties of interest.
44+
* @param {module:model/PostV2DeploymentsUpgrade200Response} obj Optional instance to populate.
45+
* @return {module:model/PostV2DeploymentsUpgrade200Response} The populated <code>PostV2DeploymentsUpgrade200Response</code> instance.
46+
*/
47+
static constructFromObject(data, obj) {
48+
if (data) {
49+
obj = obj || new PostV2DeploymentsUpgrade200Response();
50+
51+
if (data.hasOwnProperty('result')) {
52+
obj['result'] = ApiClient.convertToType(data['result'], 'String');
53+
}
54+
if (data.hasOwnProperty('data')) {
55+
obj['data'] = PostV2DeploymentsUpgrade200ResponseData.constructFromObject(data['data']);
56+
}
57+
}
58+
return obj;
59+
}
60+
61+
/**
62+
* Validates the JSON data with respect to <code>PostV2DeploymentsUpgrade200Response</code>.
63+
* @param {Object} data The plain JavaScript object bearing properties of interest.
64+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>PostV2DeploymentsUpgrade200Response</code>.
65+
*/
66+
static validateJSON(data) {
67+
// ensure the json data is a string
68+
if (data['result'] && !(typeof data['result'] === 'string' || data['result'] instanceof String)) {
69+
throw new Error("Expected the field `result` to be a primitive type in the JSON string but got " + data['result']);
70+
}
71+
// validate the optional field `data`
72+
if (data['data']) { // data not null
73+
PostV2DeploymentsUpgrade200ResponseData.validateJSON(data['data']);
74+
}
75+
76+
return true;
77+
}
78+
79+
80+
}
81+
82+
83+
84+
/**
85+
* @member {module:model/PostV2DeploymentsUpgrade200Response.ResultEnum} result
86+
*/
87+
PostV2DeploymentsUpgrade200Response.prototype['result'] = undefined;
88+
89+
/**
90+
* @member {module:model/PostV2DeploymentsUpgrade200ResponseData} data
91+
*/
92+
PostV2DeploymentsUpgrade200Response.prototype['data'] = undefined;
93+
94+
95+
96+
97+
98+
/**
99+
* Allowed values for the <code>result</code> property.
100+
* @enum {String}
101+
* @readonly
102+
*/
103+
PostV2DeploymentsUpgrade200Response['ResultEnum'] = {
104+
105+
/**
106+
* value: "success"
107+
* @const
108+
*/
109+
"success": "success"
110+
};
111+
112+
113+
114+
export default PostV2DeploymentsUpgrade200Response;
115+

0 commit comments

Comments
 (0)