@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/chunk-PYRSZWV2.mjs
+packages/ari/chunk-PYRSZWV2.mjsNew file
+71
Index: package/packages/ari/chunk-PYRSZWV2.mjs
===================================================================
--- package/packages/ari/chunk-PYRSZWV2.mjs
+++ package/packages/ari/chunk-PYRSZWV2.mjs
@@ -0,0 +1,71 @@
+import {
+  GoalMetricUpdateAriResourceOwner,
+  GoalMetricUpdateAriResourceType
+} from "./chunk-CIDEQG7W.mjs";
+import {
+  RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+  AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/goal/metric-update/manifest.ts
+var goalMetricUpdateAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+  resourceOwner: GoalMetricUpdateAriResourceOwner,
+  resourceType: GoalMetricUpdateAriResourceType,
+  resourceIdSlug: "{activationId}/{goalMetricUpdateId}",
+  resourceIdSegmentFormats: {
+    activationId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    goalMetricUpdateId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+  }
+};
+
+// src/goal/metric-update/index.ts
+var GoalMetricUpdateAri = class _GoalMetricUpdateAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._siteId = opts.cloudId || "", this._activationId = opts.resourceIdSegmentValues.activationId, this._goalMetricUpdateId = opts.resourceIdSegmentValues.goalMetricUpdateId;
+  }
+  get siteId() {
+    return this._siteId;
+  }
+  get activationId() {
+    return this._activationId;
+  }
+  get goalMetricUpdateId() {
+    return this._goalMetricUpdateId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: goalMetricUpdateAriStaticOpts.qualifier,
+      platformQualifier: goalMetricUpdateAriStaticOpts.platformQualifier,
+      cloudId: opts.siteId,
+      resourceOwner: goalMetricUpdateAriStaticOpts.resourceOwner,
+      resourceType: goalMetricUpdateAriStaticOpts.resourceType,
+      resourceId: `${opts.activationId}/${opts.goalMetricUpdateId}`,
+      resourceIdSegmentValues: {
+        activationId: opts.activationId,
+        goalMetricUpdateId: opts.goalMetricUpdateId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, goalMetricUpdateAriStaticOpts);
+    return new _GoalMetricUpdateAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, goalMetricUpdateAriStaticOpts);
+    return new _GoalMetricUpdateAri(opts);
+  }
+  getVariables() {
+    return {
+      siteId: this.siteId,
+      activationId: this.activationId,
+      goalMetricUpdateId: this.goalMetricUpdateId
+    };
+  }
+};
+
+export {
+  GoalMetricUpdateAri
+};