@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-J4KRGKQ7.mjs
+packages/ari/chunk-J4KRGKQ7.mjsNew file
+79
Index: package/packages/ari/chunk-J4KRGKQ7.mjs
===================================================================
--- package/packages/ari/chunk-J4KRGKQ7.mjs
+++ package/packages/ari/chunk-J4KRGKQ7.mjs
@@ -0,0 +1,79 @@
+import {
+  OpsgenieAlertRecipientLinkAriResourceOwner,
+  OpsgenieAlertRecipientLinkAriResourceType
+} from "./chunk-JXI5TFG4.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/opsgenie/alert-recipient-link/manifest.ts
+var opsgenieAlertRecipientLinkAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^$"),
+  resourceOwner: OpsgenieAlertRecipientLinkAriResourceOwner,
+  resourceType: OpsgenieAlertRecipientLinkAriResourceType,
+  resourceIdSlug: "{workspaceId}/{alertId}/{recipientType}/{recipientId}",
+  resourceIdSegmentFormats: {
+    workspaceId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    alertId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}(-[0-9]*)?/,
+    recipientType: /(?:user|team)/,
+    recipientId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+  }
+};
+
+// src/opsgenie/alert-recipient-link/index.ts
+var OpsgenieAlertRecipientLinkAri = class _OpsgenieAlertRecipientLinkAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._alertId = opts.resourceIdSegmentValues.alertId, this._recipientType = opts.resourceIdSegmentValues.recipientType, this._recipientId = opts.resourceIdSegmentValues.recipientId;
+  }
+  get workspaceId() {
+    return this._workspaceId;
+  }
+  get alertId() {
+    return this._alertId;
+  }
+  get recipientType() {
+    return this._recipientType;
+  }
+  get recipientId() {
+    return this._recipientId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: opsgenieAlertRecipientLinkAriStaticOpts.qualifier,
+      platformQualifier: opsgenieAlertRecipientLinkAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: opsgenieAlertRecipientLinkAriStaticOpts.resourceOwner,
+      resourceType: opsgenieAlertRecipientLinkAriStaticOpts.resourceType,
+      resourceId: `${opts.workspaceId}/${opts.alertId}/${opts.recipientType}/${opts.recipientId}`,
+      resourceIdSegmentValues: {
+        workspaceId: opts.workspaceId,
+        alertId: opts.alertId,
+        recipientType: opts.recipientType,
+        recipientId: opts.recipientId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, opsgenieAlertRecipientLinkAriStaticOpts);
+    return new _OpsgenieAlertRecipientLinkAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, opsgenieAlertRecipientLinkAriStaticOpts);
+    return new _OpsgenieAlertRecipientLinkAri(opts);
+  }
+  getVariables() {
+    return {
+      workspaceId: this.workspaceId,
+      alertId: this.alertId,
+      recipientType: this.recipientType,
+      recipientId: this.recipientId
+    };
+  }
+};
+
+export {
+  OpsgenieAlertRecipientLinkAri
+};