ExAzureCore. Operation protocol
(ex_azure_core v0.2.0)
Copy Markdown
Protocol for Azure service operations.
Service modules (like ExAzureStorage, ExAzureKeyVault) implement this protocol to define how requests are built and responses are parsed.
Example
# Service module builds an operation
operation = ExAzureStorage.list_containers()
# ExAzureCore executes it
{:ok, result} = ExAzureCore.request(operation)Implementing Custom Operations
defmodule MyOperation do
defstruct [:service, :path, :method]
end
defimpl ExAzureCore.Operation, for: MyOperation do
def perform(op, config) do
# Build and execute request
end
def stream!(op, config) do
# Return enumerable for paginated results
end
end
Summary
Functions
Executes the operation and returns the result.
Returns a stream for paginated Azure resources.
Types
@type t() :: term()
All the types that implement this protocol.
Functions
Executes the operation and returns the result.
The config map contains merged configuration from:
- Service defaults
- Global application config
- Service-specific config
- Per-request overrides
@spec stream!(t(), map()) :: Enumerable.t()
Returns a stream for paginated Azure resources.
Raises ArgumentError if the operation does not support streaming.