Current section
Files
Jump to
Current section
Files
lib/docusign/model/conditional_recipient_rule.ex
# NOTE: This file is auto generated by OpenAPI Generator
# https://openapi-generator.tech
# Do not edit this file manually.
defmodule DocuSign.Model.ConditionalRecipientRule do
@moduledoc """
A rule that defines a set of recipients and the conditions under which they will be used for the envelope.
"""
alias DocuSign.Deserializer
alias DocuSign.Model.ConditionalRecipientRuleCondition
alias DocuSign.Model.RecipientGroup
defstruct [
:conditions,
:order,
:recipientGroup,
:recipientId
]
@doc false
defimpl Jason.Encoder, for: __MODULE__ do
def encode(struct, opts) do
struct
|> Map.from_struct()
|> Enum.reject(fn {_k, v} -> is_nil(v) end)
|> Map.new()
|> Jason.Encode.map(opts)
end
end
@type t :: %__MODULE__{
:conditions => [ConditionalRecipientRuleCondition.t()] | nil,
:order => String.t() | nil,
:recipientGroup => RecipientGroup.t() | nil,
:recipientId => String.t() | nil
}
def decode(value) do
value
|> Deserializer.deserialize(
:conditions,
:list,
ConditionalRecipientRuleCondition
)
|> Deserializer.deserialize(
:recipientGroup,
:struct,
RecipientGroup
)
|> then(&struct(__MODULE__, &1))
end
end