RestResource Class

A class that represents a REST resource.


Constructors

NameDescription
RestResource(String, Boolean, ResourceHandler)Creates a new RestResource instance.
RestResource(String, Boolean, ResourceHandler, String)Creates a new RestResource instance.
RestResource(String, Boolean, Boolean, ResourceHandler)Creates a new RestResource instance.
RestResource(String, Boolean, Boolean, ResourceHandler, String)Creates a new RestResource instance.

RestResource(String, Boolean, ResourceHandler) Constructor

Creates a new RestResource instance.

1
2
3
public RestResource(string name,
    bool isCollection,
    ResourceHandler handler)
ParameterDescription
nameThe name of the resource.
isCollectionIndicates if the resource is a collection.
handlerThe resource handler function that should be called when requests for this resource are received.

RestResource(String, Boolean, ResourceHandler, String) Constructor

Creates a new RestResource instance.

1
2
3
4
public RestResource(string name,
    bool isCollection,
    ResourceHandler handler,
    string requiredCapability)
ParameterDescription
nameThe name of the resource.
isCollectionIndicates if the resource is a collection.
handlerThe resource handler function that should be called when requests for this resource are received.
requiredCapability:The capability required in a configuration for this resource to be callable.

RestResource(String, Boolean, Boolean, ResourceHandler) Constructor

Creates a new RestResource instance.

1
2
3
4
public RestResource(string name,
    bool isCollection,
    bool isDefaultCollection,
    ResourceHandler handler)
ParameterDescription
nameThe name of the resource.
isCollectionIndicates if the resource is a collection.
isDefaultCollectionIndicates if the resource is a default collection.
handlerThe resource handler function that should be called when requests for this resource are received.

RestResource(String, Boolean, Boolean, ResourceHandler, String) Constructor

Creates a new RestResource instance.

1
2
3
4
5
public RestResource(string name,
    bool isCollection,
    bool isDefaultCollection,
    ResourceHandler handler,
    string requiredCapability)
ParameterDescription
nameThe name of the resource.
isCollectionIndicates if the resource is a collection.
isDefaultCollectionIndicates if the resource is a default collection.
handlerThe resource handler function that should be called when requests for this resource are received.
requiredCapabilityThe capability required in a configuration for this resource to be callable.

Properties

PropertyProperty valueDescription
RestResource.nameStringThe resource name.
RestResource.isCollectionBooleanIndicates if the resource is a default collection.
RestResource.isDefaultCollectionBooleanIndicates if the resource is a default collection. Default collection is a collection resource that can allows collection item access by a short URL. For example: if we have 'layers' resource, it's usually allows item access by this URL: <base url>/layers/<itemID> If you make it a default collection, you will be able to access it by the short URL: <base url>/<itemID> There can only be one default collection per set of siblings. For example: if we have two siblings <base url>/layers and <base url>/tables, only one can be a default collection.
RestResource.RequiredCapabilityStringThe capability required in a configuration for a resource to be callable.

Fields

FieldField valueDescription
RestResource.operationsList<RestOperation>The operations supported by the resource.
RestResource.resourcesList<RestResource>The children resources of the resource.

Methods

NameDescription
RestResource.ToJsonObject()Converts the resource into a JsonObject instance.

RestResource.ToJsonObject() Method

Converts the resource into a JsonObject instance.

1
public JsonObject ToJsonObject()

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close