/
delete-access-point.ts
31 lines (27 loc) · 1.04 KB
/
delete-access-point.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { Command, Flags } from "@oclif/core";
import { getWebClient } from "../../../autify/web/getWebClient";
export default class WebApiDeleteAccessPoint extends Command {
static description = "You can delete an access point by passing in its name.";
static examples = ["<%= config.bin %> <%= command.id %>"];
static flags = {
"project-id": Flags.integer({
description:
"For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios",
required: true,
}),
"delete-access-point-request": Flags.string({
description: "The name of the access point to be deleted",
required: true,
}),
};
public async run(): Promise<void> {
const { flags } = await this.parse(WebApiDeleteAccessPoint);
const { configDir, userAgent } = this.config;
const client = getWebClient(configDir, userAgent);
const res = await client.deleteAccessPoint(
flags["project-id"],
JSON.parse(flags["delete-access-point-request"])
);
console.log(JSON.stringify(res.data, null, 2));
}
}