ExAzureCore.Operation.REST (ex_azure_core v0.2.0)

Copy Markdown

REST-based operation for Azure services.

Used by service modules to define operations that will be executed by ExAzureCore.request/2.

Fields

  • :service - Service atom (e.g., :storage, :keyvault, :management)
  • :http_method - HTTP method
  • :path - URL path (relative to base URL)
  • :host - Optional host override
  • :default_host - Optional fallback host, used when no :host override and no :base_url/:host is configured
  • :body - Request body (map for JSON, binary for raw)
  • :params - Query parameters
  • :headers - Additional headers
  • :parser - Optional function to parse response body
  • :stream_builder - Optional function to build pagination stream

Example

%ExAzureCore.Operation.REST{
  service: :keyvault,
  http_method: :get,
  path: "/secrets/my-secret",
  params: %{},
  parser: fn response -> response.body end
}

Summary

Types

http_method()

@type http_method() :: :get | :post | :put | :patch | :delete | :head

t()

@type t() :: %ExAzureCore.Operation.REST{
  body: term(),
  default_host: String.t() | nil,
  headers: [{String.t(), String.t()}],
  host: String.t() | nil,
  http_method: http_method(),
  params: map(),
  parser: (ExAzureCore.Http.Response.t() -> term()) | nil,
  path: String.t(),
  service: atom(),
  stream_builder: (map() -> Enumerable.t()) | nil
}