View Source CozyAliyunOpenAPI.Specs.RPC (cozy_aliyun_open_api v0.2.0)

Describes an RPC style API.

Read more at:

Examples

alias CozyAliyunOpenAPI.Config
alias CozyAliyunOpenAPI.Specs.RPC

config =
  Config.new!(%{
    access_key_id: "...",
    access_key_secret: "..."
  })

RPC.new!(config, %{
  method: :post,
  endpoint: "https://example.com/",
  shared_params: %{
    "Action" => "SingleSendMail",
    "Version" => "2015-11-23",
    # ...
  },
  params: %{
    "AccountName" => "...",
    # ...
  }
})

Summary

Types

@type endpoint() :: String.t()
@type method() :: :get | :post
@type params() ::
  %{optional(name :: String.t()) => value :: boolean() | number() | String.t()}
  | nil
@type shared_params() :: %{
  optional(name :: String.t()) => value :: boolean() | number() | String.t()
}
@type spec_config() :: %{
  method: method(),
  endpoint: endpoint(),
  shared_params: shared_params(),
  params: params()
}
@type t() :: %CozyAliyunOpenAPI.Specs.RPC{
  endpoint: endpoint(),
  method: method(),
  params: params(),
  shared_params: shared_params()
}

Functions

Link to this function

new!(config, spec_config)

View Source
@spec new!(CozyAliyunOpenAPI.Config.t(), spec_config()) :: t()