@incident-io/sdk 2.21.0 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cjs/apis/IncidentsV2Api.d.ts +25 -0
  2. package/dist/cjs/apis/IncidentsV2Api.js +47 -0
  3. package/dist/cjs/apis/ManagedResourcesV2Api.d.ts +39 -0
  4. package/dist/cjs/apis/ManagedResourcesV2Api.js +101 -0
  5. package/dist/cjs/apis/index.d.ts +1 -0
  6. package/dist/cjs/apis/index.js +1 -0
  7. package/dist/cjs/models/IncidentsConnectExternalIssuePayloadV2.d.ts +61 -0
  8. package/dist/cjs/models/IncidentsConnectExternalIssuePayloadV2.js +79 -0
  9. package/dist/cjs/models/ManagedResourceV2.d.ts +79 -0
  10. package/dist/cjs/models/ManagedResourceV2.js +94 -0
  11. package/dist/cjs/models/ManagedResourcesCreateManagedResourcePayloadV2.d.ts +62 -0
  12. package/dist/cjs/models/ManagedResourcesCreateManagedResourcePayloadV2.js +80 -0
  13. package/dist/cjs/models/ManagedResourcesCreateManagedResourceResultV2.d.ts +31 -0
  14. package/dist/cjs/models/ManagedResourcesCreateManagedResourceResultV2.js +51 -0
  15. package/dist/cjs/models/index.d.ts +4 -0
  16. package/dist/cjs/models/index.js +4 -0
  17. package/dist/cjs/version.d.ts +1 -1
  18. package/dist/cjs/version.js +1 -1
  19. package/dist/esm/apis/IncidentsV2Api.d.ts +25 -0
  20. package/dist/esm/apis/IncidentsV2Api.js +47 -0
  21. package/dist/esm/apis/ManagedResourcesV2Api.d.ts +39 -0
  22. package/dist/esm/apis/ManagedResourcesV2Api.js +64 -0
  23. package/dist/esm/apis/index.d.ts +1 -0
  24. package/dist/esm/apis/index.js +1 -0
  25. package/dist/esm/models/IncidentsConnectExternalIssuePayloadV2.d.ts +61 -0
  26. package/dist/esm/models/IncidentsConnectExternalIssuePayloadV2.js +71 -0
  27. package/dist/esm/models/ManagedResourceV2.d.ts +79 -0
  28. package/dist/esm/models/ManagedResourceV2.js +86 -0
  29. package/dist/esm/models/ManagedResourcesCreateManagedResourcePayloadV2.d.ts +62 -0
  30. package/dist/esm/models/ManagedResourcesCreateManagedResourcePayloadV2.js +72 -0
  31. package/dist/esm/models/ManagedResourcesCreateManagedResourceResultV2.d.ts +31 -0
  32. package/dist/esm/models/ManagedResourcesCreateManagedResourceResultV2.js +44 -0
  33. package/dist/esm/models/index.d.ts +4 -0
  34. package/dist/esm/models/index.js +4 -0
  35. package/dist/esm/version.d.ts +1 -1
  36. package/dist/esm/version.js +1 -1
  37. package/package.json +1 -1
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * incident.io
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ManagedResourcesCreateManagedResourcePayloadV2ResourceTypeEnum = void 0;
17
+ exports.instanceOfManagedResourcesCreateManagedResourcePayloadV2 = instanceOfManagedResourcesCreateManagedResourcePayloadV2;
18
+ exports.ManagedResourcesCreateManagedResourcePayloadV2FromJSON = ManagedResourcesCreateManagedResourcePayloadV2FromJSON;
19
+ exports.ManagedResourcesCreateManagedResourcePayloadV2FromJSONTyped = ManagedResourcesCreateManagedResourcePayloadV2FromJSONTyped;
20
+ exports.ManagedResourcesCreateManagedResourcePayloadV2ToJSON = ManagedResourcesCreateManagedResourcePayloadV2ToJSON;
21
+ exports.ManagedResourcesCreateManagedResourcePayloadV2ToJSONTyped = ManagedResourcesCreateManagedResourcePayloadV2ToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.ManagedResourcesCreateManagedResourcePayloadV2ResourceTypeEnum = {
26
+ AlertRoute: 'alert_route',
27
+ AlertSource: 'alert_source',
28
+ ApiKey: 'api_key',
29
+ IncidentForm: 'incident_form',
30
+ IncidentTemplate: 'incident_template',
31
+ EscalationPath: 'escalation_path',
32
+ EscalationPathTemplate: 'escalation_path_template',
33
+ Policy: 'policy',
34
+ Schedule: 'schedule',
35
+ ScheduleSyncTarget: 'schedule_sync_target',
36
+ ScheduleSyncRule: 'schedule_sync_rule',
37
+ Secret: 'secret',
38
+ StatusPageComponent: 'status_page_component',
39
+ StatusPageStructure: 'status_page_structure',
40
+ TeamGroupingPreference: 'team_grouping_preference',
41
+ Workflow: 'workflow',
42
+ };
43
+ /**
44
+ * Check if a given object implements the ManagedResourcesCreateManagedResourcePayloadV2 interface.
45
+ */
46
+ function instanceOfManagedResourcesCreateManagedResourcePayloadV2(value) {
47
+ if (!('annotations' in value) || value['annotations'] === undefined)
48
+ return false;
49
+ if (!('resource_id' in value) || value['resource_id'] === undefined)
50
+ return false;
51
+ if (!('resource_type' in value) || value['resource_type'] === undefined)
52
+ return false;
53
+ return true;
54
+ }
55
+ function ManagedResourcesCreateManagedResourcePayloadV2FromJSON(json) {
56
+ return ManagedResourcesCreateManagedResourcePayloadV2FromJSONTyped(json, false);
57
+ }
58
+ function ManagedResourcesCreateManagedResourcePayloadV2FromJSONTyped(json, ignoreDiscriminator) {
59
+ if (json == null) {
60
+ return json;
61
+ }
62
+ return {
63
+ 'annotations': json['annotations'],
64
+ 'resource_id': json['resource_id'],
65
+ 'resource_type': json['resource_type'],
66
+ };
67
+ }
68
+ function ManagedResourcesCreateManagedResourcePayloadV2ToJSON(json) {
69
+ return ManagedResourcesCreateManagedResourcePayloadV2ToJSONTyped(json, false);
70
+ }
71
+ function ManagedResourcesCreateManagedResourcePayloadV2ToJSONTyped(value, ignoreDiscriminator = false) {
72
+ if (value == null) {
73
+ return value;
74
+ }
75
+ return {
76
+ 'annotations': value['annotations'],
77
+ 'resource_id': value['resource_id'],
78
+ 'resource_type': value['resource_type'],
79
+ };
80
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * incident.io
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
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
+ import type { ManagedResourceV2 } from './ManagedResourceV2.js';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface ManagedResourcesCreateManagedResourceResultV2
17
+ */
18
+ export interface ManagedResourcesCreateManagedResourceResultV2 {
19
+ /**
20
+ *
21
+ */
22
+ managed_resource: ManagedResourceV2;
23
+ }
24
+ /**
25
+ * Check if a given object implements the ManagedResourcesCreateManagedResourceResultV2 interface.
26
+ */
27
+ export declare function instanceOfManagedResourcesCreateManagedResourceResultV2(value: object): value is ManagedResourcesCreateManagedResourceResultV2;
28
+ export declare function ManagedResourcesCreateManagedResourceResultV2FromJSON(json: any): ManagedResourcesCreateManagedResourceResultV2;
29
+ export declare function ManagedResourcesCreateManagedResourceResultV2FromJSONTyped(json: any, ignoreDiscriminator: boolean): ManagedResourcesCreateManagedResourceResultV2;
30
+ export declare function ManagedResourcesCreateManagedResourceResultV2ToJSON(json: any): ManagedResourcesCreateManagedResourceResultV2;
31
+ export declare function ManagedResourcesCreateManagedResourceResultV2ToJSONTyped(value?: ManagedResourcesCreateManagedResourceResultV2 | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * incident.io
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfManagedResourcesCreateManagedResourceResultV2 = instanceOfManagedResourcesCreateManagedResourceResultV2;
17
+ exports.ManagedResourcesCreateManagedResourceResultV2FromJSON = ManagedResourcesCreateManagedResourceResultV2FromJSON;
18
+ exports.ManagedResourcesCreateManagedResourceResultV2FromJSONTyped = ManagedResourcesCreateManagedResourceResultV2FromJSONTyped;
19
+ exports.ManagedResourcesCreateManagedResourceResultV2ToJSON = ManagedResourcesCreateManagedResourceResultV2ToJSON;
20
+ exports.ManagedResourcesCreateManagedResourceResultV2ToJSONTyped = ManagedResourcesCreateManagedResourceResultV2ToJSONTyped;
21
+ const ManagedResourceV2_js_1 = require("./ManagedResourceV2.js");
22
+ /**
23
+ * Check if a given object implements the ManagedResourcesCreateManagedResourceResultV2 interface.
24
+ */
25
+ function instanceOfManagedResourcesCreateManagedResourceResultV2(value) {
26
+ if (!('managed_resource' in value) || value['managed_resource'] === undefined)
27
+ return false;
28
+ return true;
29
+ }
30
+ function ManagedResourcesCreateManagedResourceResultV2FromJSON(json) {
31
+ return ManagedResourcesCreateManagedResourceResultV2FromJSONTyped(json, false);
32
+ }
33
+ function ManagedResourcesCreateManagedResourceResultV2FromJSONTyped(json, ignoreDiscriminator) {
34
+ if (json == null) {
35
+ return json;
36
+ }
37
+ return {
38
+ 'managed_resource': (0, ManagedResourceV2_js_1.ManagedResourceV2FromJSON)(json['managed_resource']),
39
+ };
40
+ }
41
+ function ManagedResourcesCreateManagedResourceResultV2ToJSON(json) {
42
+ return ManagedResourcesCreateManagedResourceResultV2ToJSONTyped(json, false);
43
+ }
44
+ function ManagedResourcesCreateManagedResourceResultV2ToJSONTyped(value, ignoreDiscriminator = false) {
45
+ if (value == null) {
46
+ return value;
47
+ }
48
+ return {
49
+ 'managed_resource': (0, ManagedResourceV2_js_1.ManagedResourceV2ToJSON)(value['managed_resource']),
50
+ };
51
+ }
@@ -868,6 +868,7 @@ export * from './IncidentUpdatesListResultV2.js';
868
868
  export * from './IncidentV1.js';
869
869
  export * from './IncidentV2.js';
870
870
  export * from './IncidentWithStatusChangeV2.js';
871
+ export * from './IncidentsConnectExternalIssuePayloadV2.js';
871
872
  export * from './IncidentsCreatePayloadV1.js';
872
873
  export * from './IncidentsCreatePayloadV2.js';
873
874
  export * from './IncidentsCreateResultV1.js';
@@ -892,6 +893,9 @@ export * from './MaintenanceWindowsListResultV1.js';
892
893
  export * from './MaintenanceWindowsShowResultV1.js';
893
894
  export * from './MaintenanceWindowsUpdatePayloadV1.js';
894
895
  export * from './MaintenanceWindowsUpdateResultV1.js';
896
+ export * from './ManagedResourceV2.js';
897
+ export * from './ManagedResourcesCreateManagedResourcePayloadV2.js';
898
+ export * from './ManagedResourcesCreateManagedResourceResultV2.js';
895
899
  export * from './ManagementMetaV2.js';
896
900
  export * from './NewSlackUserGroupPayloadV2.js';
897
901
  export * from './OnCallNotificationMethodPhoneDetailsPublicV2.js';
@@ -886,6 +886,7 @@ __exportStar(require("./IncidentUpdatesListResultV2.js"), exports);
886
886
  __exportStar(require("./IncidentV1.js"), exports);
887
887
  __exportStar(require("./IncidentV2.js"), exports);
888
888
  __exportStar(require("./IncidentWithStatusChangeV2.js"), exports);
889
+ __exportStar(require("./IncidentsConnectExternalIssuePayloadV2.js"), exports);
889
890
  __exportStar(require("./IncidentsCreatePayloadV1.js"), exports);
890
891
  __exportStar(require("./IncidentsCreatePayloadV2.js"), exports);
891
892
  __exportStar(require("./IncidentsCreateResultV1.js"), exports);
@@ -910,6 +911,9 @@ __exportStar(require("./MaintenanceWindowsListResultV1.js"), exports);
910
911
  __exportStar(require("./MaintenanceWindowsShowResultV1.js"), exports);
911
912
  __exportStar(require("./MaintenanceWindowsUpdatePayloadV1.js"), exports);
912
913
  __exportStar(require("./MaintenanceWindowsUpdateResultV1.js"), exports);
914
+ __exportStar(require("./ManagedResourceV2.js"), exports);
915
+ __exportStar(require("./ManagedResourcesCreateManagedResourcePayloadV2.js"), exports);
916
+ __exportStar(require("./ManagedResourcesCreateManagedResourceResultV2.js"), exports);
913
917
  __exportStar(require("./ManagementMetaV2.js"), exports);
914
918
  __exportStar(require("./NewSlackUserGroupPayloadV2.js"), exports);
915
919
  __exportStar(require("./OnCallNotificationMethodPhoneDetailsPublicV2.js"), exports);
@@ -1 +1 @@
1
- export declare const VERSION = "2.21.0";
1
+ export declare const VERSION = "2.23.0";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Written by `make build` from package.json. Do not edit.
5
- exports.VERSION = "2.21.0";
5
+ exports.VERSION = "2.23.0";
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime.js';
13
+ import { type IncidentsConnectExternalIssuePayloadV2 } from '../models/IncidentsConnectExternalIssuePayloadV2.js';
13
14
  import { type IncidentsCreatePayloadV2 } from '../models/IncidentsCreatePayloadV2.js';
14
15
  import { type IncidentsCreateResultV2 } from '../models/IncidentsCreateResultV2.js';
15
16
  import { type IncidentsEditPayloadV2 } from '../models/IncidentsEditPayloadV2.js';
@@ -18,6 +19,16 @@ import { type IncidentsImportPostmortemDocumentPayloadV2 } from '../models/Incid
18
19
  import { type IncidentsImportPostmortemDocumentResultV2 } from '../models/IncidentsImportPostmortemDocumentResultV2.js';
19
20
  import { type IncidentsListResultV2 } from '../models/IncidentsListResultV2.js';
20
21
  import { type IncidentsShowResultV2 } from '../models/IncidentsShowResultV2.js';
22
+ export interface IncidentsV2ConnectExternalIssueRequest {
23
+ /**
24
+ * The unique identifier of the incident
25
+ */
26
+ id: string;
27
+ /**
28
+ *
29
+ */
30
+ body: IncidentsConnectExternalIssuePayloadV2;
31
+ }
21
32
  export interface IncidentsV2CreateRequest {
22
33
  /**
23
34
  *
@@ -130,6 +141,20 @@ export interface IncidentsV2ShowRequest {
130
141
  *
131
142
  */
132
143
  export declare class IncidentsV2Api extends runtime.BaseAPI {
144
+ /**
145
+ * Creates request options for incidentsV2ConnectExternalIssue without sending the request
146
+ */
147
+ incidentsV2ConnectExternalIssueRequestOpts(requestParameters: IncidentsV2ConnectExternalIssueRequest): Promise<runtime.RequestOpts>;
148
+ /**
149
+ * Connect an existing issue in an issue tracker to an incident, as its external issue. The issue is synced using the given incident ticket template, as if incident.io had created it from that template. The next sync writes the incident\'s fields into the issue. This needs the incidents.connect_external_issue scope, either across the organisation or from an incident role on this incident. This fails if the incident already has a different external issue (unless replace is true), or if the issue is already linked to another incident or follow-up. The ID supplied can be either the incident\'s full ID, or the numeric part of its reference.
150
+ * ConnectExternalIssue Incidents V2
151
+ */
152
+ incidentsV2ConnectExternalIssueRaw(requestParameters: IncidentsV2ConnectExternalIssueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
153
+ /**
154
+ * Connect an existing issue in an issue tracker to an incident, as its external issue. The issue is synced using the given incident ticket template, as if incident.io had created it from that template. The next sync writes the incident\'s fields into the issue. This needs the incidents.connect_external_issue scope, either across the organisation or from an incident role on this incident. This fails if the incident already has a different external issue (unless replace is true), or if the issue is already linked to another incident or follow-up. The ID supplied can be either the incident\'s full ID, or the numeric part of its reference.
155
+ * ConnectExternalIssue Incidents V2
156
+ */
157
+ incidentsV2ConnectExternalIssue(requestParameters: IncidentsV2ConnectExternalIssueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
133
158
  /**
134
159
  * Creates request options for incidentsV2Create without sending the request
135
160
  */
@@ -12,6 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import * as runtime from '../runtime.js';
15
+ import { IncidentsConnectExternalIssuePayloadV2ToJSON, } from '../models/IncidentsConnectExternalIssuePayloadV2.js';
15
16
  import { IncidentsCreatePayloadV2ToJSON, } from '../models/IncidentsCreatePayloadV2.js';
16
17
  import { IncidentsCreateResultV2FromJSON, } from '../models/IncidentsCreateResultV2.js';
17
18
  import { IncidentsEditPayloadV2ToJSON, } from '../models/IncidentsEditPayloadV2.js';
@@ -24,6 +25,52 @@ import { IncidentsShowResultV2FromJSON, } from '../models/IncidentsShowResultV2.
24
25
  *
25
26
  */
26
27
  export class IncidentsV2Api extends runtime.BaseAPI {
28
+ /**
29
+ * Creates request options for incidentsV2ConnectExternalIssue without sending the request
30
+ */
31
+ async incidentsV2ConnectExternalIssueRequestOpts(requestParameters) {
32
+ if (requestParameters['id'] == null) {
33
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling incidentsV2ConnectExternalIssue().');
34
+ }
35
+ if (requestParameters['body'] == null) {
36
+ throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling incidentsV2ConnectExternalIssue().');
37
+ }
38
+ const queryParameters = {};
39
+ const headerParameters = {};
40
+ headerParameters['Content-Type'] = 'application/json';
41
+ if (this.configuration && this.configuration.accessToken) {
42
+ const token = this.configuration.accessToken;
43
+ const tokenString = await token("BearerAuth", []);
44
+ if (tokenString) {
45
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
46
+ }
47
+ }
48
+ let urlPath = `/v2/incidents/{id}/actions/connect_external_issue`;
49
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
50
+ return {
51
+ path: urlPath,
52
+ method: 'POST',
53
+ headers: headerParameters,
54
+ query: queryParameters,
55
+ body: IncidentsConnectExternalIssuePayloadV2ToJSON(requestParameters['body']),
56
+ };
57
+ }
58
+ /**
59
+ * Connect an existing issue in an issue tracker to an incident, as its external issue. The issue is synced using the given incident ticket template, as if incident.io had created it from that template. The next sync writes the incident\'s fields into the issue. This needs the incidents.connect_external_issue scope, either across the organisation or from an incident role on this incident. This fails if the incident already has a different external issue (unless replace is true), or if the issue is already linked to another incident or follow-up. The ID supplied can be either the incident\'s full ID, or the numeric part of its reference.
60
+ * ConnectExternalIssue Incidents V2
61
+ */
62
+ async incidentsV2ConnectExternalIssueRaw(requestParameters, initOverrides) {
63
+ const requestOptions = await this.incidentsV2ConnectExternalIssueRequestOpts(requestParameters);
64
+ const response = await this.request(requestOptions, initOverrides);
65
+ return new runtime.VoidApiResponse(response);
66
+ }
67
+ /**
68
+ * Connect an existing issue in an issue tracker to an incident, as its external issue. The issue is synced using the given incident ticket template, as if incident.io had created it from that template. The next sync writes the incident\'s fields into the issue. This needs the incidents.connect_external_issue scope, either across the organisation or from an incident role on this incident. This fails if the incident already has a different external issue (unless replace is true), or if the issue is already linked to another incident or follow-up. The ID supplied can be either the incident\'s full ID, or the numeric part of its reference.
69
+ * ConnectExternalIssue Incidents V2
70
+ */
71
+ async incidentsV2ConnectExternalIssue(requestParameters, initOverrides) {
72
+ await this.incidentsV2ConnectExternalIssueRaw(requestParameters, initOverrides);
73
+ }
27
74
  /**
28
75
  * Creates request options for incidentsV2Create without sending the request
29
76
  */
@@ -0,0 +1,39 @@
1
+ /**
2
+ * incident.io
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
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
+ import * as runtime from '../runtime.js';
13
+ import { type ManagedResourcesCreateManagedResourcePayloadV2 } from '../models/ManagedResourcesCreateManagedResourcePayloadV2.js';
14
+ import { type ManagedResourcesCreateManagedResourceResultV2 } from '../models/ManagedResourcesCreateManagedResourceResultV2.js';
15
+ export interface ManagedResourcesV2CreateManagedResourceRequest {
16
+ /**
17
+ *
18
+ */
19
+ body: ManagedResourcesCreateManagedResourcePayloadV2;
20
+ }
21
+ /**
22
+ *
23
+ */
24
+ export declare class ManagedResourcesV2Api extends runtime.BaseAPI {
25
+ /**
26
+ * Creates request options for managedResourcesV2CreateManagedResource without sending the request
27
+ */
28
+ managedResourcesV2CreateManagedResourceRequestOpts(requestParameters: ManagedResourcesV2CreateManagedResourceRequest): Promise<runtime.RequestOpts>;
29
+ /**
30
+ * Create or update the management record for a resource. This replaces any annotations already stored on it. The annotations set `managed_by`: - `incident.io/terraform/version` sets it to `terraform`. - `incident.io/is-managed-externally` sets it to `external`. If both keys are present, `external` wins. - Neither key sets it to `dashboard`. This doesn\'t change the resource\'s configuration, but `managed_by` controls whether it can be edited in the dashboard. Returning a schedule to `dashboard` also returns its sync rules and targets. The API key must have the update scope for the resource type, e.g. `schedules.update` for a schedule.
31
+ * CreateManagedResource Managed Resources V2
32
+ */
33
+ managedResourcesV2CreateManagedResourceRaw(requestParameters: ManagedResourcesV2CreateManagedResourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ManagedResourcesCreateManagedResourceResultV2>>;
34
+ /**
35
+ * Create or update the management record for a resource. This replaces any annotations already stored on it. The annotations set `managed_by`: - `incident.io/terraform/version` sets it to `terraform`. - `incident.io/is-managed-externally` sets it to `external`. If both keys are present, `external` wins. - Neither key sets it to `dashboard`. This doesn\'t change the resource\'s configuration, but `managed_by` controls whether it can be edited in the dashboard. Returning a schedule to `dashboard` also returns its sync rules and targets. The API key must have the update scope for the resource type, e.g. `schedules.update` for a schedule.
36
+ * CreateManagedResource Managed Resources V2
37
+ */
38
+ managedResourcesV2CreateManagedResource(requestParameters: ManagedResourcesV2CreateManagedResourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ManagedResourcesCreateManagedResourceResultV2>;
39
+ }
@@ -0,0 +1,64 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * incident.io
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ import * as runtime from '../runtime.js';
15
+ import { ManagedResourcesCreateManagedResourcePayloadV2ToJSON, } from '../models/ManagedResourcesCreateManagedResourcePayloadV2.js';
16
+ import { ManagedResourcesCreateManagedResourceResultV2FromJSON, } from '../models/ManagedResourcesCreateManagedResourceResultV2.js';
17
+ /**
18
+ *
19
+ */
20
+ export class ManagedResourcesV2Api extends runtime.BaseAPI {
21
+ /**
22
+ * Creates request options for managedResourcesV2CreateManagedResource without sending the request
23
+ */
24
+ async managedResourcesV2CreateManagedResourceRequestOpts(requestParameters) {
25
+ if (requestParameters['body'] == null) {
26
+ throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling managedResourcesV2CreateManagedResource().');
27
+ }
28
+ const queryParameters = {};
29
+ const headerParameters = {};
30
+ headerParameters['Content-Type'] = 'application/json';
31
+ if (this.configuration && this.configuration.accessToken) {
32
+ const token = this.configuration.accessToken;
33
+ const tokenString = await token("BearerAuth", []);
34
+ if (tokenString) {
35
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
36
+ }
37
+ }
38
+ let urlPath = `/v2/managed_resources`;
39
+ return {
40
+ path: urlPath,
41
+ method: 'POST',
42
+ headers: headerParameters,
43
+ query: queryParameters,
44
+ body: ManagedResourcesCreateManagedResourcePayloadV2ToJSON(requestParameters['body']),
45
+ };
46
+ }
47
+ /**
48
+ * Create or update the management record for a resource. This replaces any annotations already stored on it. The annotations set `managed_by`: - `incident.io/terraform/version` sets it to `terraform`. - `incident.io/is-managed-externally` sets it to `external`. If both keys are present, `external` wins. - Neither key sets it to `dashboard`. This doesn\'t change the resource\'s configuration, but `managed_by` controls whether it can be edited in the dashboard. Returning a schedule to `dashboard` also returns its sync rules and targets. The API key must have the update scope for the resource type, e.g. `schedules.update` for a schedule.
49
+ * CreateManagedResource Managed Resources V2
50
+ */
51
+ async managedResourcesV2CreateManagedResourceRaw(requestParameters, initOverrides) {
52
+ const requestOptions = await this.managedResourcesV2CreateManagedResourceRequestOpts(requestParameters);
53
+ const response = await this.request(requestOptions, initOverrides);
54
+ return new runtime.JSONApiResponse(response, (jsonValue) => ManagedResourcesCreateManagedResourceResultV2FromJSON(jsonValue));
55
+ }
56
+ /**
57
+ * Create or update the management record for a resource. This replaces any annotations already stored on it. The annotations set `managed_by`: - `incident.io/terraform/version` sets it to `terraform`. - `incident.io/is-managed-externally` sets it to `external`. If both keys are present, `external` wins. - Neither key sets it to `dashboard`. This doesn\'t change the resource\'s configuration, but `managed_by` controls whether it can be edited in the dashboard. Returning a schedule to `dashboard` also returns its sync rules and targets. The API key must have the update scope for the resource type, e.g. `schedules.update` for a schedule.
58
+ * CreateManagedResource Managed Resources V2
59
+ */
60
+ async managedResourcesV2CreateManagedResource(requestParameters, initOverrides) {
61
+ const response = await this.managedResourcesV2CreateManagedResourceRaw(requestParameters, initOverrides);
62
+ return await response.value();
63
+ }
64
+ }
@@ -44,6 +44,7 @@ export * from './IncidentUpdatesV2Api.js';
44
44
  export * from './IncidentsV1Api.js';
45
45
  export * from './IncidentsV2Api.js';
46
46
  export * from './MaintenanceWindowsV1Api.js';
47
+ export * from './ManagedResourcesV2Api.js';
47
48
  export * from './OnCallNotificationPausesV2Api.js';
48
49
  export * from './PayConfigsV2Api.js';
49
50
  export * from './PayReportsV2Api.js';
@@ -46,6 +46,7 @@ export * from './IncidentUpdatesV2Api.js';
46
46
  export * from './IncidentsV1Api.js';
47
47
  export * from './IncidentsV2Api.js';
48
48
  export * from './MaintenanceWindowsV1Api.js';
49
+ export * from './ManagedResourcesV2Api.js';
49
50
  export * from './OnCallNotificationPausesV2Api.js';
50
51
  export * from './PayConfigsV2Api.js';
51
52
  export * from './PayReportsV2Api.js';
@@ -0,0 +1,61 @@
1
+ /**
2
+ * incident.io
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
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
+ * @export
15
+ * @interface IncidentsConnectExternalIssuePayloadV2
16
+ */
17
+ export interface IncidentsConnectExternalIssuePayloadV2 {
18
+ /**
19
+ * ID of the incident ticket template to sync the issue with
20
+ */
21
+ issue_template_id: string;
22
+ /**
23
+ * The issue tracker provider the issue belongs to. It must match the provider of the incident ticket template.
24
+ */
25
+ provider: IncidentsConnectExternalIssuePayloadV2ProviderEnum;
26
+ /**
27
+ * Whether to replace the incident's current external issue, if it has a different one
28
+ */
29
+ replace?: boolean;
30
+ /**
31
+ * URL of the issue in the issue tracker
32
+ */
33
+ url: string;
34
+ }
35
+ /**
36
+ * @export
37
+ */
38
+ export declare const IncidentsConnectExternalIssuePayloadV2ProviderEnum: {
39
+ readonly Asana: "asana";
40
+ readonly AzureDevops: "azure_devops";
41
+ readonly ClickUp: "click_up";
42
+ readonly Freshservice: "freshservice";
43
+ readonly Linear: "linear";
44
+ readonly Jira: "jira";
45
+ readonly Salesforce: "salesforce";
46
+ readonly JiraServer: "jira_server";
47
+ readonly Github: "github";
48
+ readonly Gitlab: "gitlab";
49
+ readonly ServiceNow: "service_now";
50
+ readonly Shortcut: "shortcut";
51
+ readonly Notion: "notion";
52
+ };
53
+ export type IncidentsConnectExternalIssuePayloadV2ProviderEnum = typeof IncidentsConnectExternalIssuePayloadV2ProviderEnum[keyof typeof IncidentsConnectExternalIssuePayloadV2ProviderEnum];
54
+ /**
55
+ * Check if a given object implements the IncidentsConnectExternalIssuePayloadV2 interface.
56
+ */
57
+ export declare function instanceOfIncidentsConnectExternalIssuePayloadV2(value: object): value is IncidentsConnectExternalIssuePayloadV2;
58
+ export declare function IncidentsConnectExternalIssuePayloadV2FromJSON(json: any): IncidentsConnectExternalIssuePayloadV2;
59
+ export declare function IncidentsConnectExternalIssuePayloadV2FromJSONTyped(json: any, ignoreDiscriminator: boolean): IncidentsConnectExternalIssuePayloadV2;
60
+ export declare function IncidentsConnectExternalIssuePayloadV2ToJSON(json: any): IncidentsConnectExternalIssuePayloadV2;
61
+ export declare function IncidentsConnectExternalIssuePayloadV2ToJSONTyped(value?: IncidentsConnectExternalIssuePayloadV2 | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,71 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * incident.io
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * @export
16
+ */
17
+ export const IncidentsConnectExternalIssuePayloadV2ProviderEnum = {
18
+ Asana: 'asana',
19
+ AzureDevops: 'azure_devops',
20
+ ClickUp: 'click_up',
21
+ Freshservice: 'freshservice',
22
+ Linear: 'linear',
23
+ Jira: 'jira',
24
+ Salesforce: 'salesforce',
25
+ JiraServer: 'jira_server',
26
+ Github: 'github',
27
+ Gitlab: 'gitlab',
28
+ ServiceNow: 'service_now',
29
+ Shortcut: 'shortcut',
30
+ Notion: 'notion',
31
+ };
32
+ /**
33
+ * Check if a given object implements the IncidentsConnectExternalIssuePayloadV2 interface.
34
+ */
35
+ export function instanceOfIncidentsConnectExternalIssuePayloadV2(value) {
36
+ if (!('issue_template_id' in value) || value['issue_template_id'] === undefined)
37
+ return false;
38
+ if (!('provider' in value) || value['provider'] === undefined)
39
+ return false;
40
+ if (!('url' in value) || value['url'] === undefined)
41
+ return false;
42
+ return true;
43
+ }
44
+ export function IncidentsConnectExternalIssuePayloadV2FromJSON(json) {
45
+ return IncidentsConnectExternalIssuePayloadV2FromJSONTyped(json, false);
46
+ }
47
+ export function IncidentsConnectExternalIssuePayloadV2FromJSONTyped(json, ignoreDiscriminator) {
48
+ if (json == null) {
49
+ return json;
50
+ }
51
+ return {
52
+ 'issue_template_id': json['issue_template_id'],
53
+ 'provider': json['provider'],
54
+ 'replace': json['replace'] == null ? undefined : json['replace'],
55
+ 'url': json['url'],
56
+ };
57
+ }
58
+ export function IncidentsConnectExternalIssuePayloadV2ToJSON(json) {
59
+ return IncidentsConnectExternalIssuePayloadV2ToJSONTyped(json, false);
60
+ }
61
+ export function IncidentsConnectExternalIssuePayloadV2ToJSONTyped(value, ignoreDiscriminator = false) {
62
+ if (value == null) {
63
+ return value;
64
+ }
65
+ return {
66
+ 'issue_template_id': value['issue_template_id'],
67
+ 'provider': value['provider'],
68
+ 'replace': value['replace'],
69
+ 'url': value['url'],
70
+ };
71
+ }