GcpCompute.Disk (GcpCompute v0.3.0)

Copy Markdown View Source

Parsed disks entry of an instance.

Summary

Functions

Parse one decoded JSON disk map.

Parse a list of decoded JSON disks.

Types

t()

@type t() :: %GcpCompute.Disk{
  auto_delete: boolean() | nil,
  boot: boolean() | nil,
  device_name: String.t() | nil,
  raw: map(),
  size_gb: integer() | nil,
  source: String.t() | nil,
  type: String.t() | nil
}

Functions

from_json(map)

@spec from_json(map()) :: t()

Parse one decoded JSON disk map.

list(disks)

@spec list(term()) :: [t()]

Parse a list of decoded JSON disks.

Total: a nil, an object, or any other non-list degrades to [], and non-map entries are skipped, rather than raising two modules away from the response that caused it. The complete original body is always retained in GcpCompute.Instance's :raw.