Skip to content
import PortalItemResource from "@arcgis/core/portal/PortalItemResource.js";
Inheritance:
PortalItemResourceAccessor
Since
ArcGIS Maps SDK for JavaScript 4.16

A reference to a portal item resource.

See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
PropertyTypeClass
declaredClass
readonly inherited
url
readonly

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

path

Property
Type
string | null | undefined

Path of the resource relative to {ITEM}/resources/. Resource paths may include subfolders, but are always specified relative to the item resources endpoint.

See also

portalItem

Property
Type
PortalItem

The portal item that owns the resource.

url

readonly Property
Type
string | null | undefined

The absolute url to the item resource. This is computed from the portal item and the resource path.

Methods

MethodSignatureClass
fetch<T = unknown>(responseType?: RequestOptions["responseType"], options?: PortalItemResourceFetchOptions | null | undefined): Promise<T>
update(content: Blob, options?: PortalItemResourceAddOrUpdateOptions): Promise<PortalItemResourceWithPath>

fetch

Method
Signature
fetch <T = unknown>(responseType?: RequestOptions["responseType"], options?: PortalItemResourceFetchOptions | null | undefined): Promise<T>
Type parameters
<T = unknown>

Requests the PortalItemResource data in the format specified for the responseType.

See also
Parameters
ParameterTypeDescriptionRequired
responseType
RequestOptions["responseType"]

The format of the response.

options

An object wih the following properties.

Returns
Promise

When resolved, returns the requested data.

update

Method
Signature
update (content: Blob, options?: PortalItemResourceAddOrUpdateOptions): Promise<PortalItemResourceWithPath>

Updates an existing resource with new content.

See also
Parameters
ParameterTypeDescriptionRequired
content

The resource content.

options

An object wih the following properties.

Returns
Promise<PortalItemResourceWithPath>

When resolved, returns the PortalItemResource.

Type definitions

PortalItemResourceFetchOptions

Type definition
Supertypes
Pick<RequestOptions‚ "cacheBust" | "signal">