kura_changeset_assoc (kura v2.0.6)

View Source

Summary

Functions

cast_assoc(Kura_changeset, AssocName)

-spec cast_assoc(#kura_changeset{valid :: boolean(),
                                 schema :: module() | undefined,
                                 data :: map(),
                                 params :: map(),
                                 changes :: map(),
                                 errors :: [{atom(), binary()}],
                                 types :: #{atom() => kura_types:kura_type()},
                                 required :: [atom()],
                                 action :: atom() | undefined,
                                 constraints ::
                                     [#kura_constraint{type :: unique | foreign_key | check | exclusion,
                                                       constraint :: binary(),
                                                       field :: atom(),
                                                       message :: binary()}],
                                 assoc_changes :: #{atom() => #kura_changeset{} | [#kura_changeset{}]},
                                 prepare :: [fun((#kura_changeset{}) -> #kura_changeset{})],
                                 optimistic_lock :: atom() | undefined},
                 atom()) ->
                    #kura_changeset{valid :: boolean(),
                                    schema :: module() | undefined,
                                    data :: map(),
                                    params :: map(),
                                    changes :: map(),
                                    errors :: [{atom(), binary()}],
                                    types :: #{atom() => kura_types:kura_type()},
                                    required :: [atom()],
                                    action :: atom() | undefined,
                                    constraints ::
                                        [#kura_constraint{type ::
                                                              unique | foreign_key | check | exclusion,
                                                          constraint :: binary(),
                                                          field :: atom(),
                                                          message :: binary()}],
                                    assoc_changes ::
                                        #{atom() => #kura_changeset{} | [#kura_changeset{}]},
                                    prepare :: [fun((#kura_changeset{}) -> #kura_changeset{})],
                                    optimistic_lock :: atom() | undefined}.

cast_assoc(Kura_changeset, AssocName, Opts)

-spec cast_assoc(#kura_changeset{valid :: boolean(),
                                 schema :: module() | undefined,
                                 data :: map(),
                                 params :: map(),
                                 changes :: map(),
                                 errors :: [{atom(), binary()}],
                                 types :: #{atom() => kura_types:kura_type()},
                                 required :: [atom()],
                                 action :: atom() | undefined,
                                 constraints ::
                                     [#kura_constraint{type :: unique | foreign_key | check | exclusion,
                                                       constraint :: binary(),
                                                       field :: atom(),
                                                       message :: binary()}],
                                 assoc_changes :: #{atom() => #kura_changeset{} | [#kura_changeset{}]},
                                 prepare :: [fun((#kura_changeset{}) -> #kura_changeset{})],
                                 optimistic_lock :: atom() | undefined},
                 atom(),
                 map()) ->
                    #kura_changeset{valid :: boolean(),
                                    schema :: module() | undefined,
                                    data :: map(),
                                    params :: map(),
                                    changes :: map(),
                                    errors :: [{atom(), binary()}],
                                    types :: #{atom() => kura_types:kura_type()},
                                    required :: [atom()],
                                    action :: atom() | undefined,
                                    constraints ::
                                        [#kura_constraint{type ::
                                                              unique | foreign_key | check | exclusion,
                                                          constraint :: binary(),
                                                          field :: atom(),
                                                          message :: binary()}],
                                    assoc_changes ::
                                        #{atom() => #kura_changeset{} | [#kura_changeset{}]},
                                    prepare :: [fun((#kura_changeset{}) -> #kura_changeset{})],
                                    optimistic_lock :: atom() | undefined}.

cast_embed(Kura_changeset, EmbedName)

-spec cast_embed(#kura_changeset{valid :: boolean(),
                                 schema :: module() | undefined,
                                 data :: map(),
                                 params :: map(),
                                 changes :: map(),
                                 errors :: [{atom(), binary()}],
                                 types :: #{atom() => kura_types:kura_type()},
                                 required :: [atom()],
                                 action :: atom() | undefined,
                                 constraints ::
                                     [#kura_constraint{type :: unique | foreign_key | check | exclusion,
                                                       constraint :: binary(),
                                                       field :: atom(),
                                                       message :: binary()}],
                                 assoc_changes :: #{atom() => #kura_changeset{} | [#kura_changeset{}]},
                                 prepare :: [fun((#kura_changeset{}) -> #kura_changeset{})],
                                 optimistic_lock :: atom() | undefined},
                 atom()) ->
                    #kura_changeset{valid :: boolean(),
                                    schema :: module() | undefined,
                                    data :: map(),
                                    params :: map(),
                                    changes :: map(),
                                    errors :: [{atom(), binary()}],
                                    types :: #{atom() => kura_types:kura_type()},
                                    required :: [atom()],
                                    action :: atom() | undefined,
                                    constraints ::
                                        [#kura_constraint{type ::
                                                              unique | foreign_key | check | exclusion,
                                                          constraint :: binary(),
                                                          field :: atom(),
                                                          message :: binary()}],
                                    assoc_changes ::
                                        #{atom() => #kura_changeset{} | [#kura_changeset{}]},
                                    prepare :: [fun((#kura_changeset{}) -> #kura_changeset{})],
                                    optimistic_lock :: atom() | undefined}.

cast_embed(Kura_changeset, EmbedName, Opts)

-spec cast_embed(#kura_changeset{valid :: boolean(),
                                 schema :: module() | undefined,
                                 data :: map(),
                                 params :: map(),
                                 changes :: map(),
                                 errors :: [{atom(), binary()}],
                                 types :: #{atom() => kura_types:kura_type()},
                                 required :: [atom()],
                                 action :: atom() | undefined,
                                 constraints ::
                                     [#kura_constraint{type :: unique | foreign_key | check | exclusion,
                                                       constraint :: binary(),
                                                       field :: atom(),
                                                       message :: binary()}],
                                 assoc_changes :: #{atom() => #kura_changeset{} | [#kura_changeset{}]},
                                 prepare :: [fun((#kura_changeset{}) -> #kura_changeset{})],
                                 optimistic_lock :: atom() | undefined},
                 atom(),
                 map()) ->
                    #kura_changeset{valid :: boolean(),
                                    schema :: module() | undefined,
                                    data :: map(),
                                    params :: map(),
                                    changes :: map(),
                                    errors :: [{atom(), binary()}],
                                    types :: #{atom() => kura_types:kura_type()},
                                    required :: [atom()],
                                    action :: atom() | undefined,
                                    constraints ::
                                        [#kura_constraint{type ::
                                                              unique | foreign_key | check | exclusion,
                                                          constraint :: binary(),
                                                          field :: atom(),
                                                          message :: binary()}],
                                    assoc_changes ::
                                        #{atom() => #kura_changeset{} | [#kura_changeset{}]},
                                    prepare :: [fun((#kura_changeset{}) -> #kura_changeset{})],
                                    optimistic_lock :: atom() | undefined}.

put_assoc(Kura_changeset, AssocName, Value)

-spec put_assoc(#kura_changeset{valid :: boolean(),
                                schema :: module() | undefined,
                                data :: map(),
                                params :: map(),
                                changes :: map(),
                                errors :: [{atom(), binary()}],
                                types :: #{atom() => kura_types:kura_type()},
                                required :: [atom()],
                                action :: atom() | undefined,
                                constraints ::
                                    [#kura_constraint{type :: unique | foreign_key | check | exclusion,
                                                      constraint :: binary(),
                                                      field :: atom(),
                                                      message :: binary()}],
                                assoc_changes :: #{atom() => #kura_changeset{} | [#kura_changeset{}]},
                                prepare :: [fun((#kura_changeset{}) -> #kura_changeset{})],
                                optimistic_lock :: atom() | undefined},
                atom(),
                term()) ->
                   #kura_changeset{valid :: boolean(),
                                   schema :: module() | undefined,
                                   data :: map(),
                                   params :: map(),
                                   changes :: map(),
                                   errors :: [{atom(), binary()}],
                                   types :: #{atom() => kura_types:kura_type()},
                                   required :: [atom()],
                                   action :: atom() | undefined,
                                   constraints ::
                                       [#kura_constraint{type ::
                                                             unique | foreign_key | check | exclusion,
                                                         constraint :: binary(),
                                                         field :: atom(),
                                                         message :: binary()}],
                                   assoc_changes :: #{atom() => #kura_changeset{} | [#kura_changeset{}]},
                                   prepare :: [fun((#kura_changeset{}) -> #kura_changeset{})],
                                   optimistic_lock :: atom() | undefined}.