ArcGIS.Portal.Item (ArcGIS v1.0.2)

View Source

Provides a struct for ArcGIS portal items and functions to query, fetch, create, update, delete, and share them.

Summary

Functions

Deletes one or more portal items

Create an %ArcGIS.Portal.Item{} from a map.

Fetches an item from an ArcGIS portal by global id

Queries an ArcGIS portal for one or more items

Types

access()

@type access() :: :private | :shared | :org | :public

counts()

@type counts() :: %{
  comments: non_neg_integer(),
  ratings: non_neg_integer(),
  views: non_neg_integer()
}

deletion_results()

@type deletion_results() :: %{
  deletions: [String.t()],
  failures: [{id :: String.t(), reason :: String.t()}]
}

portal_item_search_terms()

@type portal_item_search_terms() :: %{
  keywords: [{key :: String.t(), value :: String.t()}],
  owner: String.t(),
  search_text: String.t(),
  title: String.t(),
  type: type :: String.t() | {type :: String.t(), keywords :: String.t()}
}

t()

@type t() :: %ArcGIS.Portal.Item{
  access: access(),
  accessInformation: String.t(),
  categories: [String.t()],
  counts: counts(),
  culture: String.t(),
  description: String.t(),
  documentation: String.t(),
  extent: ArcGIS.Extent.t(),
  folder: String.t() | nil,
  id: ArcGIS.Portal.id(),
  licenseInfo: String.t(),
  name: String.t(),
  owner: String.t(),
  properties: map(),
  proxyFilter: map(),
  scoreCompleteness: integer(),
  screenshots: [String.t()],
  size: integer(),
  snippet: String.t(),
  spatial_reference: ArcGIS.SpatialReference.t(),
  tags: [String.t()],
  thumbnail: String.t(),
  timestamps: ArcGIS.Timestamps.t(),
  title: String.t(),
  type: String.t(),
  type_keywords: [String.t()],
  url: String.t()
}

Functions

create(portal, item, options)

@spec create(ArcGIS.Portal.t(), t(), options :: [ArcGIS.Portal.portal_option()]) ::
  {:ok, t()} | {:error, reason :: String.t()}

delete(portal, item, options)

@spec delete(
  ArcGIS.Portal.t(),
  t() | [t()],
  options :: [ArcGIS.Portal.portal_option()]
) ::
  deletion_results()

Deletes one or more portal items

from_map(arcgis_map)

@spec from_map(map()) :: t()

Create an %ArcGIS.Portal.Item{} from a map.

Used internally to transform maps of data returned by an ArcGIS portal into item structs.

get(portal, id, options \\ [])

@spec get(
  ArcGIS.Portal.t(),
  id :: String.t(),
  options :: [ArcGIS.Portal.portal_option()]
) ::
  {:ok, t()} | {:error, reason :: String.t()}

Fetches an item from an ArcGIS portal by global id

query(portal, search_terms, options \\ [])

@spec query(
  ArcGIS.Portal.t(),
  portal_item_search_terms(),
  options :: [ArcGIS.Portal.portal_option()]
) ::
  {:ok, ArcGIS.Portal.ResultSet.t()} | {:error, reason :: String.t()}

Queries an ArcGIS portal for one or more items

share(portal, item, share_with, options)

@spec share(
  ArcGIS.Portal.t(),
  t(),
  share_with :: :everyone | :org | :private | (groups :: [String.t()]),
  [ArcGIS.Portal.portal_option()]
) :: {:ok, t()} | {:error, reason :: String.t()}

update(portal, item, options)

@spec update(ArcGIS.Portal.t(), t() | [t()], [ArcGIS.Portal.portal_option()]) :: %{
  updates: [id :: String.t()],
  failures: [{id :: String.t(), reason :: String.t()}]
}