CloudKit.Record (cloud_kit v0.3.0)

Copy Markdown View Source

Record struct representing a CloudKit record.

Fields

  • record_name: Unique record name (ID)
  • record_type: The record type/schema name
  • fields: Map of field names to CloudKit field values
  • record_change_tag: Version tag for conflict detection
  • created: Creation timestamp and user info
  • modified: Modification timestamp and user info

Summary

Functions

Build a field value map for CloudKit records.

Decode a CloudKit record from the API response.

Types

t()

@type t() :: %CloudKit.Record{
  created: map() | nil,
  fields: map() | nil,
  modified: map() | nil,
  record_change_tag: String.t() | nil,
  record_name: String.t() | nil,
  record_type: String.t() | nil
}

Functions

field_value(value, type)

@spec field_value(any(), String.t()) :: map()

Build a field value map for CloudKit records.

Field Types

  • STRING
  • INT64
  • DOUBLE
  • BOOLEAN
  • TIMESTAMP
  • ASSET
  • LOCATION
  • REFERENCE
  • STRING_LIST
  • INT64_LIST
  • DOUBLE_LIST

Examples

CloudKit.Record.field_value("Hello", "STRING")
CloudKit.Record.field_value(42, "INT64")
CloudKit.Record.field_value(3.14, "DOUBLE")
CloudKit.Record.field_value(true, "BOOLEAN")

from_map(data)

@spec from_map(map()) :: t()

Decode a CloudKit record from the API response.