Skip to content

Commit bc68ec1

Browse files
author
Marek Sierociński
committed
Added /me/account-service
1 parent f0c34e2 commit bc68ec1

11 files changed

+108
-22
lines changed

dist/api/APIListServices.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import APIListPurchased from './APIListPurchased';
33
declare class APIListServices extends APIList {
44
constructor(parent: object);
55
purchased(): APIListPurchased;
6-
available(): void;
6+
available(): APIList;
7+
active(): APIList;
78
}
89
export default APIListServices;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import APIResource from './APIResource';
2+
declare class APIResourceAccountService extends APIResource {
3+
constructor(parent: object, id: number);
4+
activate(): APIResource;
5+
deactivate(): APIResource;
6+
billingPeriod(): APIResource;
7+
}
8+
export default APIResourceAccountService;

dist/api/APIResourceUser.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ import APIListFiles from './APIListFiles';
1414
import APIListServices from './APIListServices';
1515
import APIListRuns from './APIListRuns';
1616
import APIListNotifications from './APIListNotifications';
17+
import APIResourceAccountService from './APIResourceAccountService';
1718
declare class APIResourceUser extends APIResource {
1819
constructor(parent: object, id: number | 'me');
1920
account(): APIResourceAccount;
2021
deviceTime(): APIListDeviceTime;
2122
deviceTimeSummary(): APIList;
2223
services(): APIListServices;
2324
service(id: number): APIResource;
24-
accountServiceBillingPeriod(id: number): APIResource;
25+
accountServices(): APIList;
26+
accountService(id: number): APIResourceAccountService;
2527
billingPeriods(): APIList;
2628
billingPeriod(id: number): APIResourceBillingPeriod;
2729
jobs(): APIList;

dist/bitbar-cloud-api-client.js

Lines changed: 39 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitbar/cloud-api-client",
3-
"version": "0.23.0",
3+
"version": "0.24.0",
44
"description": "Bitbar Cloud API Client for JavaScript",
55
"main": "dist/bitbar-cloud-api-client.min.js",
66
"types": "dist/index.d.ts",
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import APIResource from './APIResource'
2+
3+
/**
4+
* APIResourceAccountService
5+
*
6+
* @class
7+
* @extends APIResource
8+
*/
9+
class APIResourceAccountService extends APIResource {
10+
11+
/**
12+
* /account-services/{id}
13+
*
14+
* Constructor
15+
*/
16+
constructor (parent: object, id: number) {
17+
if (id == null) {
18+
throw new Error('Resource ID cannot be null!');
19+
}
20+
21+
super(parent);
22+
this.push('account-services', id);
23+
}
24+
25+
// /account-services/{id}/activate
26+
public activate () {
27+
return new APIResource(this).push('activate');
28+
}
29+
30+
// /account-services/{id}/deactivate
31+
public deactivate () {
32+
return new APIResource(this).push('deactivate');
33+
}
34+
35+
// /account-services/{id}/billing-period
36+
public billingPeriod () {
37+
return new APIResource(this).push('billing-period');
38+
}
39+
40+
}
41+
42+
export default APIResourceAccountService

0 commit comments

Comments
 (0)