ds_wrapper v0.1.1 DsWrapper.Key View Source

GoogleApi.Datastore.V1.Model.Key wrapper

Link to this section Summary

Link to this section Functions

Link to this function

new(kind, id_or_name \\ nil, parent \\ %Key{path: []})

View Source
new(String.t(), integer() | String.t() | nil, %GoogleApi.Datastore.V1.Model.Key{
  partitionId: term(),
  path: term()
}) :: %GoogleApi.Datastore.V1.Model.Key{partitionId: term(), path: term()}

Create a new GoogleApi.Datastore.V1.Model.Key.

Examples

iex> DsWrapper.Key.new("SomeKind")
%GoogleApi.Datastore.V1.Model.Key{path: [%GoogleApi.Datastore.V1.Model.PathElement{kind: "SomeKind"}]}

iex> DsWrapper.Key.new("SomeKind", "some-name")
%GoogleApi.Datastore.V1.Model.Key{path: [%GoogleApi.Datastore.V1.Model.PathElement{kind: "SomeKind", name: "some-name"}]}

iex> DsWrapper.Key.new("SomeKind", 1234)
%GoogleApi.Datastore.V1.Model.Key{path: [%GoogleApi.Datastore.V1.Model.PathElement{kind: "SomeKind", id: "1234"}]}