# This file is auto-generated by `mix graph.gen.schema`. Do not edit manually. defmodule GraphApi.Schema.IdentitySet do @moduledoc """ Auto-generated schema for `microsoft.graph.identitySet`. """ defstruct [:application, :device, :user] @type t :: %__MODULE__{ application: GraphApi.Schema.Identity.t() | nil, device: GraphApi.Schema.Identity.t() | nil, user: GraphApi.Schema.Identity.t() | nil } @field_mapping %{ {"application", :application}, {"device", :device}, {"user", :user} } @field_names [ "application", "device", "user" ] @doc "Mapping from camelCase API field names to snake_case struct atoms." @spec __field_mapping__() :: %{String.t() => atom()} def __field_mapping__, do: @field_mapping @doc "List of camelCase API field names (for OData `$select`)." @spec __field_names__() :: [String.t()] def __field_names__, do: @field_names @doc "Converts a camelCase string-key map (API response) into this struct." @spec from_map(map()) :: t() def from_map(map) when is_map(map) do %__MODULE__{ application: case map["application"] do nil -> nil val -> GraphApi.Schema.Identity.from_map(val) end, device: case map["device"] do nil -> nil val -> GraphApi.Schema.Identity.from_map(val) end, user: case map["user"] do nil -> nil val -> GraphApi.Schema.Identity.from_map(val) end } end @doc "Converts this struct to a camelCase string-key map. Nil fields are omitted." @spec to_map(t()) :: map() def to_map(%__MODULE__{} = struct) do [ {"application", case struct.application do nil -> nil val -> GraphApi.Schema.Identity.to_map(val) end}, {"device", case struct.device do nil -> nil val -> GraphApi.Schema.Identity.to_map(val) end}, {"user", case struct.user do nil -> nil val -> GraphApi.Schema.Identity.to_map(val) end} ] |> Enum.reject(fn {_k, v} -> is_nil(v) end) |> Map.new() end end