import PortalItemResource from "@arcgis/core/portal/PortalItemResource.js";const PortalItemResource = await $arcgis.import("@arcgis/core/portal/PortalItemResource.js");- Inheritance:
- PortalItemResource→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.16
A reference to a portal item resource.
Constructors
Constructor
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| 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.
| Property | Type | Class |
|---|---|---|
declaredClass readonly inherited | ||
| | ||
| | ||
url readonly | |
url
readonly Property
The absolute url to the item resource. This is computed from the portal item and the resource path.
Methods
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
| Parameter | Type | Description | Required |
|---|---|---|---|
| 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
| Parameter | Type | Description | Required |
|---|---|---|---|
| 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">