encode<V> static method
Implementation
static V encode<V>(
IdentityVerificationSession instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.clientReferenceId != null) {
container.encodeString(
'client_reference_id',
instance.clientReferenceId!,
);
}
if (instance.clientSecret != null) {
container.encodeString(
'client_secret',
instance.clientSecret!,
);
}
container.encodeDateTime(
'created',
instance.created,
);
container.encodeString(
'id',
instance.id,
);
if (instance.lastError != null) {
GelatoSessionLastError.encode(
instance.lastError!,
container.nestedSingleValueContainer('last_error').encoder,
);
}
if (instance.lastVerificationReport != null) {
IdentityVerificationReportOrId.encode(
instance.lastVerificationReport!,
container
.nestedSingleValueContainer('last_verification_report')
.encoder,
);
}
container.encodeBool(
'livemode',
instance.livemode,
);
container.encodeMap(
'metadata',
(container) => instance.metadata.forEach((
key,
value,
) =>
container.encodeString(
key,
value,
)),
);
container.encodeString(
'object',
'identity.verification_session',
);
if (instance.options != null) {
GelatoVerificationSessionOptions.encode(
instance.options!,
container.nestedSingleValueContainer('options').encoder,
);
}
if (instance.redaction != null) {
IdentityVerificationSessionRedaction.encode(
instance.redaction!,
container.nestedSingleValueContainer('redaction').encoder,
);
}
container.encodeString(
'status',
instance.status,
);
IdentityVerificationReportType.encode(
instance.type,
container.nestedSingleValueContainer('type').encoder,
);
if (instance.url != null) {
container.encodeString(
'url',
instance.url!,
);
}
if (instance.verifiedOutputs != null) {
GelatoVerifiedOutputs.encode(
instance.verifiedOutputs!,
container.nestedSingleValueContainer('verified_outputs').encoder,
);
}
return container.value;
}