/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { expect, test } from "vitest"; import { Incidentio } from "../index.js"; test("Catalog Entries Catalog V2 #List Entries", async () => { const incidentio = new Incidentio(); const result = await incidentio.catalogEntries.list({ catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", pageSize: 25, after: "01FDAG4SAP5TYPT98WGR2N7W91", }); expect(result).toBeDefined(); expect(result).toBeDefined(); expect(result).toEqual({ catalogEntries: [ { aliases: [ "lawrence@incident.io", "lawrence", ], archivedAt: new Date("2021-08-17T14:28:57.801578Z"), attributeValues: { "abc123": { arrayValue: [ { catalogEntry: { archivedAt: new Date("2021-08-17T14:28:57.801578Z"), catalogEntryId: "01FCNDV6P870EA6S7TK1DSYDG0", catalogEntryName: "Primary escalation", catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", }, helptext: "abc123", imageUrl: "abc123", isImageSlackIcon: false, label: "Lawrence Jones", literal: "SEV123", reference: "incident.severity", sortKey: "abc123", unavailable: false, value: "abc123", }, ], value: { catalogEntry: { archivedAt: new Date("2021-08-17T14:28:57.801578Z"), catalogEntryId: "01FCNDV6P870EA6S7TK1DSYDG0", catalogEntryName: "Primary escalation", catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", }, helptext: "abc123", imageUrl: "abc123", isImageSlackIcon: false, label: "Lawrence Jones", literal: "SEV123", reference: "incident.severity", sortKey: "abc123", unavailable: false, value: "abc123", }, }, }, catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", createdAt: new Date("2021-08-17T13:28:57.801578Z"), externalId: "761722cd-d1d7-477b-ac7e-90f9e079dc33", id: "01FCNDV6P870EA6S7TK1DSYDG0", name: "Primary On-call", rank: 3, updatedAt: new Date("2021-08-17T13:28:57.801578Z"), }, ], catalogType: { annotations: { "incident.io/catalog-importer/id": "id-of-config", }, categories: [ "issue-tracker", ], color: "yellow", createdAt: new Date("2021-08-17T13:28:57.801578Z"), description: "Represents Kubernetes clusters that we run inside of GKE.", dynamicResourceParameter: "abc123", estimatedCount: 7, icon: "alert", id: "01FCNDV6P870EA6S7TK1DSYDG0", isEditable: false, lastSyncedAt: new Date("2021-08-17T13:28:57.801578Z"), name: "Kubernetes Cluster", ranked: true, registryType: "PagerDutyService", requiredIntegrations: [ "pager_duty", ], schema: { attributes: [ { array: false, backlinkAttribute: "abc123", id: "01GW2G3V0S59R238FAHPDS1R66", mode: "manual", name: "tier", path: [ { attributeId: "abc123", attributeName: "abc123", }, ], type: "Custom[\"Service\"]", }, ], version: 1, }, semanticType: "custom", sourceRepoUrl: "https://github.com/my-company/incident-io-catalog", typeName: "Custom[\"BackstageGroup\"]", updatedAt: new Date("2021-08-17T13:28:57.801578Z"), }, paginationMeta: { after: "01FCNDV6P870EA6S7TK1DSYDG0", pageSize: 25, }, }); }); test("Catalog Entries Catalog V2 #Create Entry", async () => { const incidentio = new Incidentio(); const result = await incidentio.catalogEntries.create({ aliases: [ "lawrence@incident.io", "lawrence", ], attributeValues: { "abc123": { arrayValue: [ { literal: "SEV123", reference: "incident.severity", }, ], value: { literal: "SEV123", reference: "incident.severity", }, }, }, catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", externalId: "761722cd-d1d7-477b-ac7e-90f9e079dc33", name: "Primary On-call", rank: 3, }); expect(result).toBeDefined(); expect(result).toBeDefined(); expect(result).toEqual({ catalogEntry: { aliases: [ "lawrence@incident.io", "lawrence", ], archivedAt: new Date("2021-08-17T14:28:57.801578Z"), attributeValues: { "abc123": { arrayValue: [ { catalogEntry: { archivedAt: new Date("2021-08-17T14:28:57.801578Z"), catalogEntryId: "01FCNDV6P870EA6S7TK1DSYDG0", catalogEntryName: "Primary escalation", catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", }, helptext: "abc123", imageUrl: "abc123", isImageSlackIcon: false, label: "Lawrence Jones", literal: "SEV123", reference: "incident.severity", sortKey: "abc123", unavailable: false, value: "abc123", }, ], value: { catalogEntry: { archivedAt: new Date("2021-08-17T14:28:57.801578Z"), catalogEntryId: "01FCNDV6P870EA6S7TK1DSYDG0", catalogEntryName: "Primary escalation", catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", }, helptext: "abc123", imageUrl: "abc123", isImageSlackIcon: false, label: "Lawrence Jones", literal: "SEV123", reference: "incident.severity", sortKey: "abc123", unavailable: false, value: "abc123", }, }, }, catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", createdAt: new Date("2021-08-17T13:28:57.801578Z"), externalId: "761722cd-d1d7-477b-ac7e-90f9e079dc33", id: "01FCNDV6P870EA6S7TK1DSYDG0", name: "Primary On-call", rank: 3, updatedAt: new Date("2021-08-17T13:28:57.801578Z"), }, }); }); test("Catalog Entries Catalog V2 #Destroy Entry", async () => { const incidentio = new Incidentio(); await incidentio.catalogEntries.delete({ id: "01FCNDV6P870EA6S7TK1DSYDG0", }); }); test("Catalog Entries Catalog V2 #Show Entry", async () => { const incidentio = new Incidentio(); const result = await incidentio.catalogEntries.show({ id: "01FCNDV6P870EA6S7TK1DSYDG0", }); expect(result).toBeDefined(); expect(result).toBeDefined(); expect(result).toEqual({ catalogEntry: { aliases: [ "lawrence@incident.io", "lawrence", ], archivedAt: new Date("2021-08-17T14:28:57.801578Z"), attributeValues: { "abc123": { arrayValue: [ { catalogEntry: { archivedAt: new Date("2021-08-17T14:28:57.801578Z"), catalogEntryId: "01FCNDV6P870EA6S7TK1DSYDG0", catalogEntryName: "Primary escalation", catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", }, helptext: "abc123", imageUrl: "abc123", isImageSlackIcon: false, label: "Lawrence Jones", literal: "SEV123", reference: "incident.severity", sortKey: "abc123", unavailable: false, value: "abc123", }, ], value: { catalogEntry: { archivedAt: new Date("2021-08-17T14:28:57.801578Z"), catalogEntryId: "01FCNDV6P870EA6S7TK1DSYDG0", catalogEntryName: "Primary escalation", catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", }, helptext: "abc123", imageUrl: "abc123", isImageSlackIcon: false, label: "Lawrence Jones", literal: "SEV123", reference: "incident.severity", sortKey: "abc123", unavailable: false, value: "abc123", }, }, }, catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", createdAt: new Date("2021-08-17T13:28:57.801578Z"), externalId: "761722cd-d1d7-477b-ac7e-90f9e079dc33", id: "01FCNDV6P870EA6S7TK1DSYDG0", name: "Primary On-call", rank: 3, updatedAt: new Date("2021-08-17T13:28:57.801578Z"), }, catalogType: { annotations: { "incident.io/catalog-importer/id": "id-of-config", }, categories: [ "issue-tracker", ], color: "yellow", createdAt: new Date("2021-08-17T13:28:57.801578Z"), description: "Represents Kubernetes clusters that we run inside of GKE.", dynamicResourceParameter: "abc123", estimatedCount: 7, icon: "alert", id: "01FCNDV6P870EA6S7TK1DSYDG0", isEditable: false, lastSyncedAt: new Date("2021-08-17T13:28:57.801578Z"), name: "Kubernetes Cluster", ranked: true, registryType: "PagerDutyService", requiredIntegrations: [ "pager_duty", ], schema: { attributes: [ { array: false, backlinkAttribute: "abc123", id: "01GW2G3V0S59R238FAHPDS1R66", mode: "manual", name: "tier", path: [ { attributeId: "abc123", attributeName: "abc123", }, ], type: "Custom[\"Service\"]", }, ], version: 1, }, semanticType: "custom", sourceRepoUrl: "https://github.com/my-company/incident-io-catalog", typeName: "Custom[\"BackstageGroup\"]", updatedAt: new Date("2021-08-17T13:28:57.801578Z"), }, }); }); test("Catalog Entries Catalog V2 #Update Entry", async () => { const incidentio = new Incidentio(); const result = await incidentio.catalogEntries.update({ id: "01FCNDV6P870EA6S7TK1DSYDG0", updateEntryRequestBody: { aliases: [ "lawrence@incident.io", "lawrence", ], attributeValues: { "abc123": { arrayValue: [ { literal: "SEV123", reference: "incident.severity", }, ], value: { literal: "SEV123", reference: "incident.severity", }, }, }, externalId: "761722cd-d1d7-477b-ac7e-90f9e079dc33", name: "Primary On-call", rank: 3, }, }); expect(result).toBeDefined(); expect(result).toBeDefined(); expect(result).toEqual({ catalogEntry: { aliases: [ "lawrence@incident.io", "lawrence", ], archivedAt: new Date("2021-08-17T14:28:57.801578Z"), attributeValues: { "abc123": { arrayValue: [ { catalogEntry: { archivedAt: new Date("2021-08-17T14:28:57.801578Z"), catalogEntryId: "01FCNDV6P870EA6S7TK1DSYDG0", catalogEntryName: "Primary escalation", catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", }, helptext: "abc123", imageUrl: "abc123", isImageSlackIcon: false, label: "Lawrence Jones", literal: "SEV123", reference: "incident.severity", sortKey: "abc123", unavailable: false, value: "abc123", }, ], value: { catalogEntry: { archivedAt: new Date("2021-08-17T14:28:57.801578Z"), catalogEntryId: "01FCNDV6P870EA6S7TK1DSYDG0", catalogEntryName: "Primary escalation", catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", }, helptext: "abc123", imageUrl: "abc123", isImageSlackIcon: false, label: "Lawrence Jones", literal: "SEV123", reference: "incident.severity", sortKey: "abc123", unavailable: false, value: "abc123", }, }, }, catalogTypeId: "01FCNDV6P870EA6S7TK1DSYDG0", createdAt: new Date("2021-08-17T13:28:57.801578Z"), externalId: "761722cd-d1d7-477b-ac7e-90f9e079dc33", id: "01FCNDV6P870EA6S7TK1DSYDG0", name: "Primary On-call", rank: 3, updatedAt: new Date("2021-08-17T13:28:57.801578Z"), }, catalogType: { annotations: { "incident.io/catalog-importer/id": "id-of-config", }, categories: [ "issue-tracker", ], color: "yellow", createdAt: new Date("2021-08-17T13:28:57.801578Z"), description: "Represents Kubernetes clusters that we run inside of GKE.", dynamicResourceParameter: "abc123", estimatedCount: 7, icon: "alert", id: "01FCNDV6P870EA6S7TK1DSYDG0", isEditable: false, lastSyncedAt: new Date("2021-08-17T13:28:57.801578Z"), name: "Kubernetes Cluster", ranked: true, registryType: "PagerDutyService", requiredIntegrations: [ "pager_duty", ], schema: { attributes: [ { array: false, backlinkAttribute: "abc123", id: "01GW2G3V0S59R238FAHPDS1R66", mode: "manual", name: "tier", path: [ { attributeId: "abc123", attributeName: "abc123", }, ], type: "Custom[\"Service\"]", }, ], version: 1, }, semanticType: "custom", sourceRepoUrl: "https://github.com/my-company/incident-io-catalog", typeName: "Custom[\"BackstageGroup\"]", updatedAt: new Date("2021-08-17T13:28:57.801578Z"), }, }); });