DSpace.API.Operation.JSON (dspace_ex v0.1.0-alpha2)

Copy Markdown View Source

Represents a JSON operation against the DSpace API.

This module is usually not used directly. Operation data structures are constructed by API operation modules. Building your own operations is useful in cases where dspace_ex doesn't support a specific API functionality yet.

The before_step field allows to specify a function to be called at execution time. It takes the operation, the client configuration and override options and allows to modify them before the HTTP request is made or produce other side effects based on their data.

Summary

Functions

Creates a new JSON operation from the given options.

Types

t()

@type t() :: %DSpace.API.Operation.JSON{
  before_step: function() | nil,
  content_type: :json | :form | :multipart | :uri_list,
  csrf: :auto | :required | :optional | :skip,
  data: map() | list() | binary() | nil,
  expected_status: [non_neg_integer()] | nil,
  headers: %{optional(binary()) => [binary()]},
  http_method: :get | :head | :post | :put | :patch | :delete,
  params: keyword(),
  path: binary(),
  stream_impl: function() | nil,
  transformer: function(),
  version_overrides: [{binary(), keyword()}]
}

Functions

new(options)

@spec new(keyword()) :: t()

Creates a new JSON operation from the given options.