Class Asset

Summary

Create an instance of Asset class with a given asset id and optional attributes and session credentials.

Usage

await new Asset(topia, "assetId", {
attributes: { assetName: "My Asset", isPublic: false },
credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
});

Hierarchy

Implements

Constructors

Properties

credentials: undefined | InteractiveCredentials
id?: string
jwt?: string
requestOptions: object
topia: Topia

Methods

  • Parameters

    • __namedParameters: {
          error?: unknown;
          message?: string;
          params?: object;
          sdkMethod?: string;
      }
      • Optional error?: unknown
      • Optional message?: string
      • Optional params?: object
      • Optional sdkMethod?: string

    Returns {
        data: {};
        message: string;
        method: string;
        params: object;
        sdkMethod: undefined | string;
        stack: string;
        stackTrace: Error;
        status: number;
        success: boolean;
        url: string;
    }

    • data: {}
      • message: string
      • method: string
      • params: object
      • sdkMethod: undefined | string
      • stack: string
      • stackTrace: Error
      • status: number
      • success: boolean
      • url: string
    • Summary

      Retrieves platform asset details.

      Usage

      await asset.fetchAssetById();
      const { assetName } = asset;

      Returns Promise<object | ResponseType>

    • Returns AxiosInstance

    • Summary

      Updates platform asset details.

      Usage

      await asset.updateAsset({
      assetName: "exampleAsset",
      bottomLayerURL: null,
      creatorTags: { "decorations": true },
      isPublic: true,
      shouldUploadImages: true,
      tagJson: "[{"label":"decorations","value":"decorations"}]",
      topLayerURL: "https://example.topLayerURL"
      });
      const { assetName } = asset;

      Parameters

      • __namedParameters: {
            assetName: string;
            bottomLayerURL?: string;
            creatorTags: object;
            isPublic: boolean;
            shouldUploadImages?: boolean;
            tagJson: string;
            topLayerURL?: string;
        }
        • assetName: string
        • Optional bottomLayerURL?: string
        • creatorTags: object
        • isPublic: boolean
        • Optional shouldUploadImages?: boolean
        • tagJson: string
        • Optional topLayerURL?: string

      Returns Promise<void | ResponseType>