diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 18b58818..27b70020 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,6 +20,7 @@ jobs: channel: 'stable' - name: Install Dependencies run: flutter pub get && cd example && flutter pub get && cd .. + - name: Lint Flutter run: flutter analyze Android: diff --git a/android/build.gradle b/android/build.gradle index 13c0b1e1..22a718d0 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -87,6 +87,7 @@ android { dependencies { implementation "com.smileidentity:android-sdk:${smileVersion}" implementation "androidx.core:core-ktx" + implementation "androidx.activity:activity-compose:1.9.3" implementation "androidx.compose.ui:ui" implementation 'androidx.lifecycle:lifecycle-viewmodel-compose' implementation "androidx.compose.material3:material3" @@ -96,7 +97,7 @@ android { implementation "com.google.mlkit:object-detection:17.0.2" testImplementation "org.jetbrains.kotlin:kotlin-test" - testImplementation "io.mockk:mockk:1.13.13" + testImplementation "io.mockk:mockk:1.13.14" } } @@ -105,4 +106,4 @@ ktlint { filter { exclude { it.file.path.contains(".g.kt") } } -} +} \ No newline at end of file diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index cc947c56..72777793 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1 +1,61 @@ - + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt b/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt index b8e3b1c7..f675e5e0 100644 --- a/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt +++ b/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt @@ -44,6 +44,7 @@ import FlutterUploadImageInfo import FlutterUploadRequest import FlutterValidDocument import FlutterValidDocumentsResponse +import android.os.Bundle import com.smileidentity.models.ActionResult import com.smileidentity.models.Actions import com.smileidentity.models.Antifraud @@ -115,35 +116,35 @@ fun convertNonNullMapToNullable(map: Map): Map fun FlutterJobType.toRequest() = when (this) { - FlutterJobType.ENHANCEDKYC -> JobType.EnhancedKyc - FlutterJobType.DOCUMENTVERIFICATION -> JobType.DocumentVerification - FlutterJobType.BIOMETRICKYC -> JobType.BiometricKyc - FlutterJobType.ENHANCEDDOCUMENTVERIFICATION -> JobType.EnhancedDocumentVerification - FlutterJobType.SMARTSELFIEENROLLMENT -> JobType.SmartSelfieEnrollment - FlutterJobType.SMARTSELFIEAUTHENTICATION -> JobType.SmartSelfieAuthentication + FlutterJobType.ENHANCED_KYC -> JobType.EnhancedKyc + FlutterJobType.DOCUMENT_VERIFICATION -> JobType.DocumentVerification + FlutterJobType.BIOMETRIC_KYC -> JobType.BiometricKyc + FlutterJobType.ENHANCED_DOCUMENT_VERIFICATION -> JobType.EnhancedDocumentVerification + FlutterJobType.SMART_SELFIE_ENROLLMENT -> JobType.SmartSelfieEnrollment + FlutterJobType.SMART_SELFIE_AUTHENTICATION -> JobType.SmartSelfieAuthentication } fun JobType.toResponse() = when (this) { - JobType.EnhancedKyc -> FlutterJobType.ENHANCEDKYC - JobType.DocumentVerification -> FlutterJobType.DOCUMENTVERIFICATION - JobType.BiometricKyc -> FlutterJobType.BIOMETRICKYC - JobType.EnhancedDocumentVerification -> FlutterJobType.ENHANCEDDOCUMENTVERIFICATION - JobType.SmartSelfieEnrollment -> FlutterJobType.SMARTSELFIEENROLLMENT - JobType.SmartSelfieAuthentication -> FlutterJobType.SMARTSELFIEAUTHENTICATION + JobType.EnhancedKyc -> FlutterJobType.ENHANCED_KYC + JobType.DocumentVerification -> FlutterJobType.DOCUMENT_VERIFICATION + JobType.BiometricKyc -> FlutterJobType.BIOMETRIC_KYC + JobType.EnhancedDocumentVerification -> FlutterJobType.ENHANCED_DOCUMENT_VERIFICATION + JobType.SmartSelfieEnrollment -> FlutterJobType.SMART_SELFIE_ENROLLMENT + JobType.SmartSelfieAuthentication -> FlutterJobType.SMART_SELFIE_AUTHENTICATION else -> TODO("Not yet implemented") } fun FlutterJobTypeV2.toRequest() = when (this) { - FlutterJobTypeV2.SMARTSELFIEAUTHENTICATION -> JobTypeV2.SmartSelfieAuthentication - FlutterJobTypeV2.SMARTSELFIEENROLLMENT -> JobTypeV2.SmartSelfieEnrollment + FlutterJobTypeV2.SMART_SELFIE_AUTHENTICATION -> JobTypeV2.SmartSelfieAuthentication + FlutterJobTypeV2.SMART_SELFIE_ENROLLMENT -> JobTypeV2.SmartSelfieEnrollment } fun JobTypeV2.toResponse() = when (this) { - JobTypeV2.SmartSelfieAuthentication -> FlutterJobTypeV2.SMARTSELFIEAUTHENTICATION - JobTypeV2.SmartSelfieEnrollment -> FlutterJobTypeV2.SMARTSELFIEENROLLMENT + JobTypeV2.SmartSelfieAuthentication -> FlutterJobTypeV2.SMART_SELFIE_AUTHENTICATION + JobTypeV2.SmartSelfieEnrollment -> FlutterJobTypeV2.SMART_SELFIE_ENROLLMENT else -> TODO("Not yet implemented") } @@ -222,14 +223,14 @@ fun FlutterUploadImageInfo.toRequest() = fun FlutterImageType.toRequest() = when (this) { - FlutterImageType.SELFIEJPGFILE -> ImageType.SelfieJpgFile - FlutterImageType.IDCARDJPGFILE -> ImageType.IdCardJpgFile - FlutterImageType.SELFIEJPGBASE64 -> ImageType.SelfieJpgBase64 - FlutterImageType.IDCARDJPGBASE64 -> ImageType.IdCardJpgBase64 - FlutterImageType.LIVENESSJPGFILE -> ImageType.LivenessJpgFile - FlutterImageType.IDCARDREARJPGFILE -> ImageType.IdCardRearJpgFile - FlutterImageType.LIVENESSJPGBASE64 -> ImageType.LivenessJpgBase64 - FlutterImageType.IDCARDREARJPGBASE64 -> ImageType.IdCardRearJpgBase64 + FlutterImageType.SELFIE_JPG_FILE -> ImageType.SelfieJpgFile + FlutterImageType.ID_CARD_JPG_FILE -> ImageType.IdCardJpgFile + FlutterImageType.SELFIE_JPG_BASE64 -> ImageType.SelfieJpgBase64 + FlutterImageType.ID_CARD_JPG_BASE64 -> ImageType.IdCardJpgBase64 + FlutterImageType.LIVENESS_JPG_FILE -> ImageType.LivenessJpgFile + FlutterImageType.ID_CARD_REAR_JPG_FILE -> ImageType.IdCardRearJpgFile + FlutterImageType.LIVENESS_JPG_BASE64 -> ImageType.LivenessJpgBase64 + FlutterImageType.ID_CARD_REAR_JPG_BASE64 -> ImageType.IdCardRearJpgBase64 } fun FlutterIdInfo.toRequest() = @@ -311,20 +312,21 @@ fun ActionResult.toResponse() = ActionResult.Completed -> FlutterActionResult.COMPLETED ActionResult.Approved -> FlutterActionResult.APPROVED ActionResult.Verified -> FlutterActionResult.VERIFIED - ActionResult.ProvisionallyApproved -> FlutterActionResult.PROVISIONALLYAPPROVED + ActionResult.ProvisionallyApproved -> FlutterActionResult.PROVISIONALLY_APPROVED ActionResult.Returned -> FlutterActionResult.RETURNED - ActionResult.NotReturned -> FlutterActionResult.NOTRETURNED + ActionResult.NotReturned -> FlutterActionResult.NOT_RETURNED ActionResult.Failed -> FlutterActionResult.FAILED ActionResult.Rejected -> FlutterActionResult.REJECTED - ActionResult.UnderReview -> FlutterActionResult.UNDERREVIEW - ActionResult.UnableToDetermine -> FlutterActionResult.UNABLETODETERMINE - ActionResult.NotApplicable -> FlutterActionResult.NOTAPPLICABLE - ActionResult.NotVerified -> FlutterActionResult.NOTVERIFIED - ActionResult.NotDone -> FlutterActionResult.NOTDONE - ActionResult.IssuerUnavailable -> FlutterActionResult.ISSUERUNAVAILABLE + ActionResult.UnderReview -> FlutterActionResult.UNDER_REVIEW + ActionResult.UnableToDetermine -> FlutterActionResult.UNABLE_TO_DETERMINE + ActionResult.NotApplicable -> FlutterActionResult.NOT_APPLICABLE + ActionResult.NotVerified -> FlutterActionResult.NOT_VERIFIED + ActionResult.NotDone -> FlutterActionResult.NOT_DONE + ActionResult.IssuerUnavailable -> FlutterActionResult.ISSUER_UNAVAILABLE ActionResult.IdAuthorityPhotoNotAvailable -> - FlutterActionResult.IDAUTHORITYPHOTONOTAVAILABLE - ActionResult.SentToHumanReview -> FlutterActionResult.SENTTOHUMANREVIEW + FlutterActionResult.ID_AUTHORITY_PHOTO_NOT_AVAILABLE + + ActionResult.SentToHumanReview -> FlutterActionResult.SENT_TO_HUMAN_REVIEW ActionResult.Unknown -> FlutterActionResult.UNKNOWN } @@ -623,3 +625,32 @@ fun FlutterConfig.toRequest() = prodBaseUrl = prodBaseUrl, sandboxBaseUrl = sandboxBaseUrl, ) + +fun SmartSelfieResponse.buildBundle() = + Bundle().apply { + this.putString("code", code) + this.putString("created_at", createdAt) + this.putString("job_id", jobId) + this.putString("job_type", jobType.name) + this.putString("message", message) + this.putString("partner_id", partnerId) + this.putBundle( + "partner_params", + Bundle().apply { + partnerParams.forEach { + putString(it.key, it.value) + } + }, + ) + this.putString("status", status.name) + this.putString("updated_at", updatedAt) + this.putString("user_id", userId) + } + +fun List.pathList(): ArrayList = + ArrayList().let { + this.forEach { item -> + it.add(item.absolutePath) + } + return it + } diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDBiometricKYCActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDBiometricKYCActivity.kt new file mode 100644 index 00000000..e4f13972 --- /dev/null +++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDBiometricKYCActivity.kt @@ -0,0 +1,94 @@ +package com.smileidentity.flutter + +import android.content.Intent +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import com.smileidentity.SmileID +import com.smileidentity.compose.BiometricKYC +import com.smileidentity.models.IdInfo +import com.smileidentity.results.SmileIDResult +import com.smileidentity.util.randomJobId +import com.smileidentity.util.randomUserId +import kotlinx.collections.immutable.toImmutableMap + +class SmileIDBiometricKYCActivity : ComponentActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val country = intent.getStringExtra("country") ?: "" + val idType = intent.getStringExtra("idType") + val idNumber = intent.getStringExtra("idNumber") + val firstName = intent.getStringExtra("firstName") + val middleName = intent.getStringExtra("middleName") + val lastName = intent.getStringExtra("lastName") + val dob = intent.getStringExtra("dob") + val bankCode = intent.getStringExtra("bankCode") + val entered = + if (intent.hasExtra("entered")) intent.getBooleanExtra("entered", false) else null + val userId = intent.getStringExtra("userId") ?: randomUserId() + val jobId = intent.getStringExtra("jobId") ?: randomJobId() + val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false) + val allowAgentMode = intent.getBooleanExtra("allowAgentMode", false) + val showAttribution = intent.getBooleanExtra("showAttribution", true) + val showInstructions = intent.getBooleanExtra("showInstructions", true) + val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams") + val extraPartnerParams = + extraPartnerParamsBundle?.keySet()?.associateWith { + extraPartnerParamsBundle.getString(it) + } as? Map ?: emptyMap() + + setContent { + SmileID.BiometricKYC( + idInfo = IdInfo( + country = country, + idType = idType, + idNumber = idNumber, + firstName = firstName, + middleName = middleName, + lastName = lastName, + dob = dob, + bankCode = bankCode, + entered = entered, + ), + userId = userId, + jobId = jobId, + allowNewEnroll = allowNewEnroll, + allowAgentMode = allowAgentMode, + showAttribution = showAttribution, + showInstructions = showInstructions, + extraPartnerParams = extraPartnerParams.toImmutableMap(), + ) { + val intent = Intent() + when (it) { + + is SmileIDResult.Success -> { + intent.putExtra("selfieFile", it.data.selfieFile.absolutePath) + intent.putStringArrayListExtra( + "livenessFiles", + it.data.livenessFiles.pathList(), + ) + intent.putExtra( + "didSubmitBiometricKycJob", + it.data.didSubmitBiometricKycJob, + ) + + setResult(RESULT_OK, intent) + finish() + } + + is SmileIDResult.Error -> { + intent.putExtra("error", it.throwable.message) + setResult(RESULT_CANCELED, intent) + finish() + } + } + } + } + } + + companion object { + const val REQUEST_CODE = 16 + } +} \ No newline at end of file diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentCaptureActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentCaptureActivity.kt new file mode 100644 index 00000000..ef43223d --- /dev/null +++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentCaptureActivity.kt @@ -0,0 +1,285 @@ +package com.smileidentity.flutter + +import android.content.Intent +import android.graphics.BitmapFactory +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue +import androidx.compose.runtime.toMutableStateList +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.asImageBitmap +import androidx.compose.ui.graphics.painter.BitmapPainter +import androidx.compose.ui.res.stringResource +import androidx.lifecycle.viewmodel.compose.viewModel +import com.smileidentity.R +import com.smileidentity.SmileID +import com.smileidentity.compose.components.ImageCaptureConfirmationDialog +import com.smileidentity.compose.components.LocalMetadata +import com.smileidentity.compose.document.DocumentCaptureInstructionsScreen +import com.smileidentity.compose.document.DocumentCaptureScreen +import com.smileidentity.compose.document.DocumentCaptureSide +import com.smileidentity.compose.theme.colorScheme +import com.smileidentity.compose.theme.typography +import com.smileidentity.models.v2.Metadata +import com.smileidentity.util.randomJobId +import com.smileidentity.viewmodel.document.DocumentCaptureViewModel +import com.smileidentity.viewmodel.viewModelFactory +import java.io.File +import java.net.URLDecoder +import java.nio.charset.StandardCharsets + +class SmileIDDocumentCaptureActivity : ComponentActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val isDocumentFrontSide = intent.getBooleanExtra("isDocumentFrontSide", true) + val showInstructions = intent.getBooleanExtra("showInstructions", true) + val showAttribution = intent.getBooleanExtra("showAttribution", true) + val allowGalleryUpload = intent.getBooleanExtra("allowGalleryUpload", false) + val showConfirmationDialog = intent.getBooleanExtra("showConfirmationDialog", true) + val idAspectRatio = intent.getDoubleExtra("idAspectRatio", -1.0).let { + if (it == -1.0) return@let null + return@let it.toFloat() + } + + setContent { + RenderDocumentCaptureContent( + isDocumentFrontSide = isDocumentFrontSide, + showInstructions = showInstructions, + showAttribution = showAttribution, + allowGalleryUpload = allowGalleryUpload, + showConfirmationDialog = showConfirmationDialog, + idAspectRatio = idAspectRatio, + ) + } + } + + @Composable + private fun RenderDocumentCaptureContent( + isDocumentFrontSide: Boolean, + showInstructions: Boolean, + showAttribution: Boolean, + allowGalleryUpload: Boolean, + showConfirmationDialog: Boolean, + idAspectRatio: Float?, + ) { + var acknowledgedInstructions by rememberSaveable { mutableStateOf(false) } + var galleryDocumentUri: String? by rememberSaveable { mutableStateOf(null) } + var documentImageToConfirm: File? by rememberSaveable { mutableStateOf(null) } + val jobId = randomJobId() + val metadata = LocalMetadata.current + val side = + if (isDocumentFrontSide) { + DocumentCaptureSide.Front + } else { + DocumentCaptureSide.Back + } + val viewModel: DocumentCaptureViewModel = + viewModel( + factory = + viewModelFactory { + DocumentCaptureViewModel( + jobId = jobId, + side = side, + knownAspectRatio = idAspectRatio, + metadata = metadata, + ) + }, + ) + + CompositionLocalProvider( + LocalMetadata provides remember { Metadata.default().items.toMutableStateList() }, + ) { + MaterialTheme( + colorScheme = SmileID.colorScheme, + typography = SmileID.typography, + ) { + Surface( + modifier = Modifier.fillMaxSize(), + ) { + when { + showInstructions && !acknowledgedInstructions -> + RenderDocumentCaptureInstructionsScreen( + isDocumentFrontSide = isDocumentFrontSide, + showAttribution = showAttribution, + allowGalleryUpload = allowGalleryUpload, + ) { uri -> + acknowledgedInstructions = true + galleryDocumentUri = + uri?.let { + URLDecoder.decode(it, StandardCharsets.UTF_8.toString()) + } + } + + showConfirmationDialog && documentImageToConfirm != null -> + RenderDocumentCaptureConfirmationScreen( + documentImageToConfirm = documentImageToConfirm!!, + isDocumentFrontSide = isDocumentFrontSide, + ) { + documentImageToConfirm = null + + // in case the user chooses to retake an image after a photo gallery + // upload, we redirect the user to the instructions screen + if (galleryDocumentUri != null) { + galleryDocumentUri = null + acknowledgedInstructions = false + } + } + + else -> + RenderDocumentCaptureScreen( + isDocumentFrontSide = isDocumentFrontSide, + idAspectRatio = idAspectRatio, + galleryDocumentUri = galleryDocumentUri, + jobId = jobId, + viewModel = viewModel, + showConfirmation = showConfirmationDialog, + ) { file -> + documentImageToConfirm = file + } + } + } + } + } + } + + @Composable + private fun RenderDocumentCaptureInstructionsScreen( + isDocumentFrontSide: Boolean, + showAttribution: Boolean, + allowGalleryUpload: Boolean, + onInstructionsAcknowledged: (String?) -> Unit, + ) { + val hero = + if (isDocumentFrontSide) { + R.drawable.si_doc_v_front_hero + } else { + R.drawable.si_doc_v_back_hero + } + val instructionTitle = + if (isDocumentFrontSide) { + R.string.si_doc_v_instruction_title + } else { + R.string.si_doc_v_instruction_back_title + } + val instructionSubTitle = + if (isDocumentFrontSide) { + R.string.si_verify_identity_instruction_subtitle + } else { + R.string.si_doc_v_instruction_back_subtitle + } + DocumentCaptureInstructionsScreen( + modifier = Modifier.fillMaxSize(), + heroImage = hero, + title = stringResource(instructionTitle), + subtitle = stringResource(instructionSubTitle), + showAttribution = showAttribution, + allowPhotoFromGallery = allowGalleryUpload, + showSkipButton = false, + onSkip = {}, + onInstructionsAcknowledgedSelectFromGallery = { uri -> + onInstructionsAcknowledged(uri) + }, + onInstructionsAcknowledgedTakePhoto = { + onInstructionsAcknowledged(null) + }, + ) + } + + @Composable + private fun RenderDocumentCaptureConfirmationScreen( + documentImageToConfirm: File, + isDocumentFrontSide: Boolean, + onRetake: () -> Unit, + ) { + ImageCaptureConfirmationDialog( + modifier = Modifier.fillMaxSize(), + titleText = stringResource(R.string.si_doc_v_confirmation_dialog_title), + subtitleText = stringResource(R.string.si_doc_v_confirmation_dialog_subtitle), + painter = + BitmapPainter( + BitmapFactory + .decodeFile(documentImageToConfirm.absolutePath) + .asImageBitmap(), + ), + confirmButtonText = + stringResource(R.string.si_doc_v_confirmation_dialog_confirm_button), + onConfirm = { + handleConfirmation(isDocumentFrontSide, documentImageToConfirm) + }, + retakeButtonText = stringResource(R.string.si_doc_v_confirmation_dialog_retake_button), + onRetake = onRetake, + scaleFactor = 1.0f, + ) + } + + @Composable + private fun RenderDocumentCaptureScreen( + isDocumentFrontSide: Boolean, + idAspectRatio: Float?, + galleryDocumentUri: String?, + jobId: String, + viewModel: DocumentCaptureViewModel, + showConfirmation: Boolean, + onConfirm: (File?) -> Unit, + ) { + val captureTitleText = + if (isDocumentFrontSide) { + R.string.si_doc_v_capture_instructions_front_title + } else { + R.string.si_doc_v_capture_instructions_back_title + } + DocumentCaptureScreen( + modifier = Modifier.fillMaxSize(), + jobId = jobId, + side = if (isDocumentFrontSide) DocumentCaptureSide.Front else DocumentCaptureSide.Back, + captureTitleText = stringResource(captureTitleText), + knownIdAspectRatio = idAspectRatio, + onConfirm = { file -> + if (!showConfirmation) { + handleConfirmation(isDocumentFrontSide, file) + } else { + onConfirm(file) + } + }, + onError = { throwable -> + val intent = Intent() + intent.putExtra("error", throwable.message) + setResult(RESULT_CANCELED, intent) + finish() + }, + galleryDocumentUri = galleryDocumentUri, + viewModel = viewModel, + ) + } + + private fun handleConfirmation( + isDocumentFrontSide: Boolean, + file: File, + ) { + val intent = Intent() + + intent.putExtra( + if (isDocumentFrontSide) "documentFrontFile" else "documentBackFile", + file.absolutePath, + ) + + setResult(RESULT_OK, intent) + finish() + } + + companion object { + const val REQUEST_CODE = 20 + } +} \ No newline at end of file diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentVerificationActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentVerificationActivity.kt new file mode 100644 index 00000000..418bc060 --- /dev/null +++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentVerificationActivity.kt @@ -0,0 +1,95 @@ +package com.smileidentity.flutter + +import android.content.Intent +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import com.smileidentity.SmileID +import com.smileidentity.compose.DocumentVerification +import com.smileidentity.results.SmileIDResult +import com.smileidentity.util.randomJobId +import com.smileidentity.util.randomUserId +import kotlinx.collections.immutable.toImmutableMap +import java.io.File + +class SmileIDDocumentVerificationActivity : ComponentActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val countryCode = intent.getStringExtra("countryCode") ?: "" + val documentType = intent.getStringExtra("documentType") + val idAspectRatio = intent.getDoubleExtra("idAspectRatio", -1.0).let { + if (it == -1.0) return@let null + return@let it.toFloat() + } + val captureBothSides = intent.getBooleanExtra("captureBothSides", true) + val bypassSelfieCaptureWithFile = + intent.getStringExtra("bypassSelfieCaptureWithFile")?.let { + File(it) + } + val userId = intent.getStringExtra("userId") ?: randomUserId() + val jobId = intent.getStringExtra("jobId") ?: randomJobId() + val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false) + val showAttribution = intent.getBooleanExtra("showAttribution", true) + val allowAgentMode = intent.getBooleanExtra("allowAgentMode", false) + val allowGalleryUpload = intent.getBooleanExtra("allowGalleryUpload", false) + val showInstructions = intent.getBooleanExtra("showInstructions", true) + val skipApiSubmission = intent.getBooleanExtra("skipApiSubmission", false) + val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams") + val extraPartnerParams = + extraPartnerParamsBundle?.keySet()?.associateWith { + extraPartnerParamsBundle.getString(it) + } as? Map ?: emptyMap() + + setContent { + SmileID.DocumentVerification( + countryCode = countryCode, + documentType = documentType, + idAspectRatio = idAspectRatio, + captureBothSides = captureBothSides, + bypassSelfieCaptureWithFile = bypassSelfieCaptureWithFile, + userId = userId, + jobId = jobId, + allowNewEnroll = allowNewEnroll, + showAttribution = showAttribution, + allowAgentMode = allowAgentMode, + allowGalleryUpload = allowGalleryUpload, + showInstructions = showInstructions, + skipApiSubmission = skipApiSubmission, + extraPartnerParams = extraPartnerParams.toImmutableMap(), + ) { + val intent = Intent() + when (it) { + is SmileIDResult.Success -> { + intent.putExtra("selfieFile", it.data.selfieFile.absolutePath) + intent.putExtra("documentFrontFile", it.data.documentFrontFile.absolutePath) + intent.putStringArrayListExtra( + "livenessFiles", + it.data.livenessFiles?.pathList(), + ) + intent.putExtra("documentBackFile", it.data.documentBackFile?.absolutePath) + intent.putExtra( + "didSubmitDocumentVerificationJob", + it.data.didSubmitDocumentVerificationJob, + ) + + setResult(RESULT_OK, intent) + finish() + } + + is SmileIDResult.Error -> { + intent.putExtra("error", it.throwable.message) + setResult(RESULT_CANCELED, intent) + finish() + } + } + } + } + } + + + companion object { + const val REQUEST_CODE = 17 + } +} \ No newline at end of file diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDEnhancedDocumentVerificationActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDEnhancedDocumentVerificationActivity.kt new file mode 100644 index 00000000..1bfae544 --- /dev/null +++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDEnhancedDocumentVerificationActivity.kt @@ -0,0 +1,97 @@ +package com.smileidentity.flutter + +import android.content.Intent +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import com.smileidentity.SmileID +import com.smileidentity.compose.EnhancedDocumentVerificationScreen +import com.smileidentity.results.SmileIDResult +import com.smileidentity.util.randomJobId +import com.smileidentity.util.randomUserId +import kotlinx.collections.immutable.toImmutableMap +import java.io.File + +class SmileIDEnhancedDocumentVerificationActivity : ComponentActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val countryCode = intent.getStringExtra("countryCode") ?: "" + val documentType = intent.getStringExtra("documentType") + val idAspectRatio = intent.getDoubleExtra("idAspectRatio", -1.0).let { + if (it == -1.0) return@let null + return@let it.toFloat() + } + val captureBothSides = intent.getBooleanExtra("captureBothSides", true) + val bypassSelfieCaptureWithFile = + intent.getStringExtra("bypassSelfieCaptureWithFile")?.let { + File(it) + } + val userId = intent.getStringExtra("userId") ?: randomUserId() + val jobId = intent.getStringExtra("jobId") ?: randomJobId() + val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false) + val showAttribution = intent.getBooleanExtra("showAttribution", true) + val allowAgentMode = intent.getBooleanExtra("allowAgentMode", false) + val allowGalleryUpload = intent.getBooleanExtra("allowGalleryUpload", false) + val showInstructions = intent.getBooleanExtra("showInstructions", true) + val skipApiSubmission = intent.getBooleanExtra("skipApiSubmission", false) + val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams") + val extraPartnerParams = + extraPartnerParamsBundle?.keySet()?.associateWith { + extraPartnerParamsBundle.getString(it) + } as? Map ?: emptyMap() + + setContent { + SmileID.EnhancedDocumentVerificationScreen( + countryCode = countryCode, + documentType = documentType, + idAspectRatio = idAspectRatio, + captureBothSides = captureBothSides, + bypassSelfieCaptureWithFile = bypassSelfieCaptureWithFile, + userId = userId, + jobId = jobId, + allowNewEnroll = allowNewEnroll, + showAttribution = showAttribution, + allowAgentMode = allowAgentMode, + allowGalleryUpload = allowGalleryUpload, + showInstructions = showInstructions, + skipApiSubmission = skipApiSubmission, + extraPartnerParams = extraPartnerParams.toImmutableMap(), + ) { + val intent = Intent() + when (it) { + is SmileIDResult.Success -> { + intent.putExtra("selfieFile", it.data.selfieFile.absolutePath) + intent.putExtra("documentFrontFile", it.data.documentFrontFile.absolutePath) + intent.putStringArrayListExtra( + "livenessFiles", + it.data.livenessFiles?.pathList(), + ) + intent.putExtra("documentBackFile", it.data.documentBackFile?.absolutePath) + intent.putExtra( + "didSubmitEnhancedDocVJob", + it.data.didSubmitEnhancedDocVJob, + ) + + setResult(RESULT_OK, intent) + finish() + } + + is SmileIDResult.Error -> { + intent.putExtra("error", it.throwable.message) + setResult(RESULT_CANCELED, intent) + finish() + } + + } + } + } + + } + + + companion object { + const val REQUEST_CODE = 18 + } +} \ No newline at end of file diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDPlugin.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDPlugin.kt index 75e956ee..122b61b6 100644 --- a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDPlugin.kt +++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDPlugin.kt @@ -52,12 +52,15 @@ class SmileIDPlugin : SmileIDApi, ActivityAware { private var activity: Activity? = null - private lateinit var appContext: Context + private lateinit var context: Context + private val productsApi = SmileIDProductsPluginApi() + private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO) override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { SmileIDApi.setUp(flutterPluginBinding.binaryMessenger, this) - appContext = flutterPluginBinding.applicationContext + productsApi.onAttachedToEngine(flutterPluginBinding) + context = flutterPluginBinding.applicationContext flutterPluginBinding.platformViewRegistry.registerViewFactory( SmileIDDocumentVerification.VIEW_TYPE_ID, @@ -107,6 +110,7 @@ class SmileIDPlugin : override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { SmileIDApi.setUp(binding.binaryMessenger, null) + productsApi.onDetachedFromEngine(binding) } override fun initializeWithApiKey( @@ -116,7 +120,7 @@ class SmileIDPlugin : enableCrashReporting: Boolean, ) { SmileID.initialize( - context = appContext, + context = context, apiKey = apiKey, config = config.toRequest(), useSandbox = useSandbox, @@ -130,7 +134,7 @@ class SmileIDPlugin : enableCrashReporting: Boolean, ) { SmileID.initialize( - context = appContext, + context = context, config = config.toRequest(), useSandbox = useSandbox, enableCrashReporting = false, @@ -139,7 +143,7 @@ class SmileIDPlugin : override fun initialize(useSandbox: Boolean) { SmileID.initialize( - context = appContext, + context = context, useSandbox = useSandbox, ) } @@ -443,13 +447,16 @@ class SmileIDPlugin : */ override fun onAttachedToActivity(binding: ActivityPluginBinding) { this.activity = binding.activity + productsApi.onAttachActivity(this.activity) + binding.addActivityResultListener(productsApi) } override fun onDetachedFromActivityForConfigChanges() {} override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {} - override fun onDetachedFromActivity() {} + override fun onDetachedFromActivity() { + } } /** diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDProductsPluginApi.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDProductsPluginApi.kt new file mode 100644 index 00000000..aec99855 --- /dev/null +++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDProductsPluginApi.kt @@ -0,0 +1,637 @@ +package com.smileidentity.flutter + +import BiometricKYCCaptureResult +import BiometricKYCCreationParams +import DocumentCaptureCreationParams +import DocumentCaptureResult +import DocumentVerificationCreationParams +import DocumentVerificationEnhancedCreationParams +import SelfieCaptureViewCreationParams +import SmartSelfieCaptureResult +import SmartSelfieCreationParams +import SmartSelfieEnhancedCreationParams +import SmileFlutterError +import SmileIDProductsApi +import android.app.Activity +import android.content.Intent +import android.os.Bundle +import com.smileidentity.flutter.enhanced.SmileIDSmartSelfieAuthenticationEnhancedActivity +import com.smileidentity.flutter.enhanced.SmileIDSmartSelfieEnrollmentEnhancedActivity +import io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding +import io.flutter.plugin.common.PluginRegistry.ActivityResultListener + +class SmileIDProductsPluginApi : + ActivityResultListener, + SmileIDProductsApi { + private var activity: Activity? = null + private var smartSelfieResult: ((Result) -> Unit)? = null + private var documentCaptureResult: ((Result) -> Unit)? = null + private var biometricKycResult: ((Result) -> Unit)? = null + + fun onAttachActivity(activity: Activity?) { + this.activity = activity + } + + fun onAttachedToEngine(binding: FlutterPluginBinding) { + SmileIDProductsApi.setUp(binding.binaryMessenger, this) + } + + fun onDetachedFromEngine(binding: FlutterPluginBinding) { + SmileIDProductsApi.setUp(binding.binaryMessenger, null) + } + + override fun onActivityResult( + requestCode: Int, + resultCode: Int, + data: Intent?, + ): Boolean { + when (requestCode) { + SmileIDSmartSelfieEnrollmentActivity.REQUEST_CODE -> { + smartSelfieResult?.let { resultCallback -> + handleSelfieResult( + resultCode, + data, + SmileIDSmartSelfieEnrollmentActivity.REQUEST_CODE.toString(), + resultCallback, + ) + + smartSelfieResult = null + return true + } + + return false + } + + SmileIDSmartSelfieAuthenticationActivity.REQUEST_CODE -> { + smartSelfieResult?.let { resultCallback -> + handleSelfieResult( + resultCode, + data, + SmileIDSmartSelfieAuthenticationActivity.REQUEST_CODE.toString(), + resultCallback, + ) + + smartSelfieResult = null + return true + } + + return false + } + + SmileIDSmartSelfieEnrollmentEnhancedActivity.REQUEST_CODE -> { + smartSelfieResult?.let { resultCallback -> + handleSelfieResult( + resultCode, + data, + SmileIDSmartSelfieEnrollmentEnhancedActivity.REQUEST_CODE.toString(), + resultCallback, + ) + + smartSelfieResult = null + return true + } + + return false + } + + SmileIDSmartSelfieAuthenticationEnhancedActivity.REQUEST_CODE -> { + smartSelfieResult?.let { resultCallback -> + handleSelfieResult( + resultCode, + data, + SmileIDSmartSelfieAuthenticationEnhancedActivity.REQUEST_CODE.toString(), + resultCallback, + ) + + smartSelfieResult = null + return true + } + + return false + } + + SmileIDSelfieCaptureActivity.REQUEST_CODE -> { + smartSelfieResult?.let { resultCallback -> + handleSelfieResult( + resultCode, + data, + SmileIDSelfieCaptureActivity.REQUEST_CODE.toString(), + resultCallback, + ) + + smartSelfieResult = null + return true + } + + return false + } + + SmileIDDocumentVerificationActivity.REQUEST_CODE -> { + documentCaptureResult?.let { resultCallback -> + handleDocumentResult( + resultCode, + data, + SmileIDDocumentVerificationActivity.REQUEST_CODE.toString(), + resultCallback, + ) + + documentCaptureResult = null + return true + } + + return false + } + + SmileIDEnhancedDocumentVerificationActivity.REQUEST_CODE -> { + documentCaptureResult?.let { resultCallback -> + handleDocumentResult( + resultCode, + data, + SmileIDEnhancedDocumentVerificationActivity.REQUEST_CODE.toString(), + resultCallback, + ) + + documentCaptureResult = null + return true + } + + return false + } + + SmileIDDocumentCaptureActivity.REQUEST_CODE -> { + documentCaptureResult?.let { resultCallback -> + handleDocumentResult( + resultCode, + data, + SmileIDDocumentCaptureActivity.REQUEST_CODE.toString(), + resultCallback, + ) + + documentCaptureResult = null + return true + } + + return false + } + + SmileIDBiometricKYCActivity.REQUEST_CODE -> { + biometricKycResult?.let { resultCallback -> + val errorCode = SmileIDBiometricKYCActivity.REQUEST_CODE.toString() + when (resultCode) { + Activity.RESULT_OK -> { + val result = BiometricKYCCaptureResult( + selfieFile = data?.getStringExtra("selfieFile") ?: "", + livenessFiles = data?.getStringArrayListExtra("livenessFiles") + ?: emptyList(), + didSubmitBiometricKycJob = data?.getBooleanExtra( + "didSubmitBiometricKycJob", + false, + ), + ) + + resultCallback.invoke(Result.success(result)) + } + + Activity.RESULT_CANCELED -> { + val error = data?.getStringExtra("error") ?: "Unknown error" + resultCallback.invoke( + Result.failure( + SmileFlutterError( + errorCode, + message = error, + ), + ), + ) + } + + else -> { + resultCallback( + Result.failure( + SmileFlutterError( + errorCode, + message = "User cancelled operation", + ), + ), + ) + } + } + + biometricKycResult = null + return true + } + + return false + } + + else -> { + return false + } + } + } + + override fun documentVerification( + creationParams: DocumentVerificationCreationParams, + callback: (Result) -> Unit, + ) { + val intent = Intent(activity, SmileIDDocumentVerificationActivity::class.java) + intent.putExtra("countryCode", creationParams.countryCode) + intent.putExtra("documentType", creationParams.documentType) + intent.putExtra("idAspectRatio", creationParams.idAspectRatio) + intent.putExtra("captureBothSides", creationParams.captureBothSides) + intent.putExtra("bypassSelfieCaptureWithFile", creationParams.bypassSelfieCaptureWithFile) + intent.putExtra("userId", creationParams.userId) + intent.putExtra("jobId", creationParams.jobId) + intent.putExtra("allowNewEnroll", creationParams.allowNewEnroll) + intent.putExtra("showAttribution", creationParams.showAttribution) + intent.putExtra("allowAgentMode", creationParams.allowAgentMode) + intent.putExtra("allowGalleryUpload", creationParams.allowGalleryUpload) + intent.putExtra("showInstructions", creationParams.showInstructions) + intent.putExtra("skipApiSubmission", creationParams.skipApiSubmission) + intent.putExtra( + "extraPartnerParams", + Bundle().apply { + creationParams.extraPartnerParams?.forEach { (key, value) -> + putString(key, value) + } + }, + ) + + if (activity != null) { + documentCaptureResult = callback + activity!!.startActivityForResult( + intent, + SmileIDDocumentVerificationActivity.REQUEST_CODE, + ) + } else + callback( + Result.failure( + SmileFlutterError( + SmileIDDocumentVerificationActivity.REQUEST_CODE.toString(), + "Failed to start document verification", + ), + ), + ) + } + + override fun documentVerificationEnhanced( + creationParams: DocumentVerificationEnhancedCreationParams, + callback: (Result) -> Unit, + ) { + val intent = Intent(activity, SmileIDEnhancedDocumentVerificationActivity::class.java) + intent.putExtra("countryCode", creationParams.countryCode) + intent.putExtra("documentType", creationParams.documentType) + intent.putExtra("idAspectRatio", creationParams.idAspectRatio) + intent.putExtra("captureBothSides", creationParams.captureBothSides) + intent.putExtra("bypassSelfieCaptureWithFile", creationParams.bypassSelfieCaptureWithFile) + intent.putExtra("userId", creationParams.userId) + intent.putExtra("jobId", creationParams.jobId) + intent.putExtra("allowNewEnroll", creationParams.allowNewEnroll) + intent.putExtra("showAttribution", creationParams.showAttribution) + intent.putExtra("allowAgentMode", creationParams.allowAgentMode) + intent.putExtra("allowGalleryUpload", creationParams.allowGalleryUpload) + intent.putExtra("showInstructions", creationParams.showInstructions) + intent.putExtra("skipApiSubmission", creationParams.skipApiSubmission) + intent.putExtra( + "extraPartnerParams", + Bundle().apply { + creationParams.extraPartnerParams?.forEach { (key, value) -> + putString(key, value) + } + }, + ) + + if (activity != null) { + documentCaptureResult = callback + activity!!.startActivityForResult( + intent, + SmileIDEnhancedDocumentVerificationActivity.REQUEST_CODE, + ) + } else + callback( + Result.failure( + SmileFlutterError( + SmileIDEnhancedDocumentVerificationActivity.REQUEST_CODE.toString(), + "Failed to start enhanced document verification", + ), + ), + ) + } + + override fun smartSelfieEnrollment( + creationParams: SmartSelfieCreationParams, + callback: (Result) -> Unit, + ) { + val intent = Intent(activity, SmileIDSmartSelfieEnrollmentActivity::class.java) + intent.putSmartSelfieCreationParams(creationParams) + + if (activity != null) { + smartSelfieResult = callback + activity!!.startActivityForResult( + intent, + SmileIDSmartSelfieEnrollmentActivity.REQUEST_CODE, + ) + } else + callback( + Result.failure( + SmileFlutterError( + SmileIDSmartSelfieEnrollmentActivity.REQUEST_CODE.toString(), + "Failed to start smart selfie enrollment", + ), + ), + ) + } + + override fun smartSelfieAuthentication( + creationParams: SmartSelfieCreationParams, + callback: (Result) -> Unit, + ) { + val intent = Intent(activity, SmileIDSmartSelfieAuthenticationActivity::class.java) + intent.putSmartSelfieCreationParams(creationParams) + + if (activity != null) { + smartSelfieResult = callback + activity!!.startActivityForResult( + intent, + SmileIDSmartSelfieAuthenticationActivity.REQUEST_CODE, + ) + } else + callback( + Result.failure( + SmileFlutterError( + SmileIDSmartSelfieAuthenticationActivity.REQUEST_CODE.toString(), + "Failed to start smart selfie authentication", + ), + ), + ) + } + + override fun smartSelfieEnrollmentEnhanced( + creationParams: SmartSelfieEnhancedCreationParams, + callback: (Result) -> Unit, + ) { + val intent = Intent(activity, SmileIDSmartSelfieEnrollmentEnhancedActivity::class.java) + intent.putSmartSelfieEnhancedCreationParams(creationParams) + + if (activity != null) { + smartSelfieResult = callback + activity!!.startActivityForResult( + intent, + SmileIDSmartSelfieEnrollmentEnhancedActivity.REQUEST_CODE, + ) + } else + callback( + Result.failure( + SmileFlutterError( + SmileIDSmartSelfieEnrollmentEnhancedActivity.REQUEST_CODE.toString(), + "Failed to start smart selfie enrollment enhanced", + ), + ), + ) + } + + override fun smartSelfieAuthenticationEnhanced( + creationParams: SmartSelfieEnhancedCreationParams, + callback: (Result) -> Unit, + ) { + val intent = Intent(activity, SmileIDSmartSelfieAuthenticationEnhancedActivity::class.java) + intent.putSmartSelfieEnhancedCreationParams(creationParams) + + if (activity != null) { + smartSelfieResult = callback + activity?.startActivityForResult( + intent, + SmileIDSmartSelfieAuthenticationEnhancedActivity.REQUEST_CODE, + ) + } else + callback( + Result.failure( + SmileFlutterError( + SmileIDSmartSelfieAuthenticationEnhancedActivity.REQUEST_CODE.toString(), + "Failed to start smart selfie authentication enhanced", + ), + ), + ) + } + + override fun biometricKYC( + creationParams: BiometricKYCCreationParams, + callback: (Result) -> Unit, + ) { + val intent = Intent(activity, SmileIDBiometricKYCActivity::class.java) + intent.putExtra("country", creationParams.country) + intent.putExtra("idType", creationParams.idType) + intent.putExtra("idNumber", creationParams.idNumber) + intent.putExtra("firstName", creationParams.firstName) + intent.putExtra("middleName", creationParams.middleName) + intent.putExtra("lastName", creationParams.lastName) + intent.putExtra("dob", creationParams.dob) + intent.putExtra("bankCode", creationParams.bankCode) + intent.putExtra("entered", creationParams.entered) + intent.putExtra("userId", creationParams.userId) + intent.putExtra("jobId", creationParams.jobId) + intent.putExtra("allowNewEnroll", creationParams.allowNewEnroll) + intent.putExtra("allowAgentMode", creationParams.allowAgentMode) + intent.putExtra("showAttribution", creationParams.showAttribution) + intent.putExtra("showInstructions", creationParams.showInstructions) + intent.putExtra( + "extraPartnerParams", + Bundle().apply { + creationParams.extraPartnerParams?.forEach { (key, value) -> + putString(key, value) + } + }, + ) + + if (activity != null) { + biometricKycResult = callback + activity!!.startActivityForResult(intent, SmileIDBiometricKYCActivity.REQUEST_CODE) + } else + callback( + Result.failure( + SmileFlutterError( + SmileIDBiometricKYCActivity.REQUEST_CODE.toString(), + "Failed to start biometric KYC", + ), + ), + ) + } + + override fun selfieCapture( + creationParams: SelfieCaptureViewCreationParams, + callback: (Result) -> Unit, + ) { + val intent = Intent(activity, SmileIDSelfieCaptureActivity::class.java) + intent.putExtra("showConfirmationDialog", creationParams.showConfirmationDialog) + intent.putExtra("showInstructions", creationParams.showInstructions) + intent.putExtra("showAttribution", creationParams.showAttribution) + intent.putExtra("allowAgentMode", creationParams.allowAgentMode) + + if (activity != null) { + smartSelfieResult = callback + activity!!.startActivityForResult(intent, SmileIDSelfieCaptureActivity.REQUEST_CODE) + } else + callback( + Result.failure( + SmileFlutterError( + SmileIDSelfieCaptureActivity.REQUEST_CODE.toString(), + "Failed to start selfie capture", + ), + ), + ) + } + + + override fun documentCapture( + creationParams: DocumentCaptureCreationParams, + callback: (Result) -> Unit, + ) { + val intent = Intent(activity, SmileIDDocumentCaptureActivity::class.java) + intent.putExtra("isDocumentFrontSide", creationParams.isDocumentFrontSide) + intent.putExtra("showInstructions", creationParams.showInstructions) + intent.putExtra("showAttribution", creationParams.showAttribution) + intent.putExtra("allowGalleryUpload", creationParams.allowGalleryUpload) + intent.putExtra("showConfirmationDialog", creationParams.showConfirmationDialog) + intent.putExtra("idAspectRatio", creationParams.idAspectRatio) + + if (activity != null) { + documentCaptureResult = callback + activity!!.startActivityForResult(intent, SmileIDDocumentCaptureActivity.REQUEST_CODE) + } else + callback( + Result.failure( + SmileFlutterError( + SmileIDDocumentCaptureActivity.REQUEST_CODE.toString(), + "Failed to start document capture", + ), + ), + ) + } +} + +private fun Intent.putSmartSelfieCreationParams(creationParams: SmartSelfieCreationParams) = + this.apply { + putExtra("userId", creationParams.userId) + putExtra("allowNewEnroll", creationParams.allowNewEnroll) + putExtra("allowAgentMode", creationParams.allowAgentMode) + putExtra("showAttribution", creationParams.showAttribution) + putExtra("showInstructions", creationParams.showInstructions) + putExtra("skipApiSubmission", creationParams.skipApiSubmission) + putExtra( + "extraPartnerParams", + Bundle().apply { + creationParams.extraPartnerParams?.forEach { (key, value) -> + putString(key, value) + } + }, + ) + } + +private fun Intent.putSmartSelfieEnhancedCreationParams( + creationParams: SmartSelfieEnhancedCreationParams, +) = this.apply { + putExtra("userId", creationParams.userId) + putExtra("allowNewEnroll", creationParams.allowNewEnroll) + putExtra("showAttribution", creationParams.showAttribution) + putExtra("showInstructions", creationParams.showInstructions) + putExtra( + "extraPartnerParams", + Bundle().apply { + creationParams.extraPartnerParams?.forEach { (key, value) -> + putString(key, value) + } + }, + ) +} + +private fun handleSelfieResult( + resultCode: Int, + data: Intent?, + errorCode: String, + resultCallback: (Result) -> Unit, +) { + when (resultCode) { + Activity.RESULT_OK -> { + val apiResponseBundle = data?.getBundleExtra("apiResponse") + val apiResponse = + apiResponseBundle?.keySet()?.associateWith { + return@associateWith if (apiResponseBundle.getString(it) != null) { + apiResponseBundle.getString(it) + } else { + val newBundle = apiResponseBundle.getBundle(it) + newBundle?.keySet()?.associateWith { key -> + newBundle.getString(key) + } + } + } as Map? ?: emptyMap() + + val result = + SmartSelfieCaptureResult( + selfieFile = data?.getStringExtra("selfieFile") ?: "", + livenessFiles = + data?.getStringArrayListExtra("livenessFiles") + ?: emptyList(), + apiResponse = apiResponse, + ) + resultCallback.invoke(Result.success(result)) + } + + Activity.RESULT_CANCELED -> { + val error = data?.getStringExtra("error") ?: "Unknown error" + resultCallback.invoke(Result.failure(SmileFlutterError(errorCode, message = error))) + } + + else -> { + resultCallback.invoke( + Result.failure( + SmileFlutterError( + errorCode, + message = "User cancelled operation", + ), + ), + ) + } + } +} + +private fun handleDocumentResult( + resultCode: Int, + data: Intent?, + errorCode: String, + resultCallback: (Result) -> Unit, +) { + + when (resultCode) { + Activity.RESULT_OK -> { + val result = DocumentCaptureResult( + selfieFile = data?.getStringExtra("selfieFile") ?: "", + livenessFiles = data?.getStringArrayListExtra("livenessFiles") ?: emptyList(), + documentFrontFile = data?.getStringExtra("documentFrontFile") ?: "", + documentBackFile = data?.getStringExtra("documentBackFile") ?: "", + didSubmitDocumentVerificationJob = if (data?.hasExtra("didSubmitDocumentVerificationJob") == true) data?.getBooleanExtra( + "didSubmitDocumentVerificationJob", + false, + ) else null, + didSubmitEnhancedDocVJob = if (data?.hasExtra("didSubmitEnhanceDocVJob") == true + ) data.getBooleanExtra("didSubmitEnhanceDocVJob", false) else null, + ) + + resultCallback.invoke(Result.success(result)) + } + + Activity.RESULT_CANCELED -> { + val error = data?.getStringExtra("error") ?: "Unknown error" + resultCallback.invoke(Result.failure(SmileFlutterError(errorCode, message = error))) + } + + else -> { + resultCallback.invoke( + Result.failure( + SmileFlutterError( + errorCode, + message = "User cancelled operation", + ), + ), + ) + } + } +} \ No newline at end of file diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSelfieCaptureActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSelfieCaptureActivity.kt new file mode 100644 index 00000000..4a676a03 --- /dev/null +++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSelfieCaptureActivity.kt @@ -0,0 +1,225 @@ +package com.smileidentity.flutter + +import android.content.Intent +import android.graphics.BitmapFactory +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.consumeWindowInsets +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.statusBars +import androidx.compose.foundation.layout.windowInsetsPadding +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue +import androidx.compose.runtime.toMutableStateList +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.asImageBitmap +import androidx.compose.ui.graphics.painter.BitmapPainter +import androidx.compose.ui.res.stringResource +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import androidx.lifecycle.viewmodel.compose.viewModel +import com.smileidentity.R +import com.smileidentity.SmileID +import com.smileidentity.SmileIDOptIn +import com.smileidentity.compose.components.ImageCaptureConfirmationDialog +import com.smileidentity.compose.components.LocalMetadata +import com.smileidentity.compose.selfie.SelfieCaptureScreen +import com.smileidentity.compose.selfie.SmartSelfieInstructionsScreen +import com.smileidentity.compose.theme.colorScheme +import com.smileidentity.compose.theme.typography +import com.smileidentity.models.v2.Metadata +import com.smileidentity.results.SmileIDResult +import com.smileidentity.util.randomJobId +import com.smileidentity.util.randomUserId +import com.smileidentity.viewmodel.SelfieUiState +import com.smileidentity.viewmodel.SelfieViewModel +import com.smileidentity.viewmodel.viewModelFactory + +class SmileIDSelfieCaptureActivity : ComponentActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val showConfirmationDialog = intent.getBooleanExtra("showConfirmationDialog", true) + val showInstructions = intent.getBooleanExtra("showInstructions", true) + val showAttribution = intent.getBooleanExtra("showAttribution", true) + val allowAgentMode = intent.getBooleanExtra("allowAgentMode", true) + + setContent { + RenderSelfieCaptureViewContent( + showConfirmationDialog = showConfirmationDialog, + showInstructions = showInstructions, + showAttribution = showAttribution, + allowAgentMode = allowAgentMode, + ) + } + } + + @OptIn(SmileIDOptIn::class) + @Composable + private fun RenderSelfieCaptureViewContent( + showConfirmationDialog: Boolean, + showInstructions: Boolean, + showAttribution: Boolean, + allowAgentMode: Boolean, + ) { + var acknowledgedInstructions by rememberSaveable { mutableStateOf(false) } + val userId = randomUserId() + val jobId = randomJobId() + val metadata = LocalMetadata.current + val viewModel: SelfieViewModel = + viewModel( + factory = + viewModelFactory { + SelfieViewModel( + isEnroll = false, + userId = userId, + jobId = jobId, + allowNewEnroll = false, + skipApiSubmission = true, + metadata = metadata, + ) + }, + ) + val uiState = viewModel.uiState.collectAsStateWithLifecycle().value + CompositionLocalProvider( + LocalMetadata provides remember { Metadata.default().items.toMutableStateList() }, + ) { + MaterialTheme(colorScheme = SmileID.colorScheme, typography = SmileID.typography) { + Surface( + content = { + when { + showInstructions && !acknowledgedInstructions -> + SmartSelfieInstructionsScreen( + showAttribution = showAttribution, + ) { + acknowledgedInstructions = true + } + + uiState.processingState != null -> HandleProcessingState(viewModel) + uiState.selfieToConfirm != null -> + HandleSelfieConfirmation( + showConfirmationDialog, + uiState, + viewModel, + ) + + else -> RenderSelfieCaptureScreen( + userId, + jobId, + allowAgentMode, + viewModel, + ) + } + }, + ) + } + } + } + + + @Composable + private fun RenderSelfieCaptureScreen( + userId: String, + jobId: String, + allowAgentMode: Boolean, + viewModel: SelfieViewModel, + ) { + Box( + modifier = + Modifier + .background(color = Color.White) + .windowInsetsPadding(WindowInsets.statusBars) + .consumeWindowInsets(WindowInsets.statusBars) + .fillMaxSize(), + ) { + SelfieCaptureScreen( + userId = userId, + jobId = jobId, + allowAgentMode = allowAgentMode, + allowNewEnroll = false, + skipApiSubmission = true, + viewModel = viewModel, + ) + } + } + + @Composable + private fun HandleSelfieConfirmation( + showConfirmation: Boolean, + uiState: SelfieUiState, + viewModel: SelfieViewModel, + ) { + if (showConfirmation) { + ImageCaptureConfirmationDialog( + titleText = stringResource(R.string.si_smart_selfie_confirmation_dialog_title), + subtitleText = + stringResource( + R.string.si_smart_selfie_confirmation_dialog_subtitle, + ), + painter = + BitmapPainter( + BitmapFactory + .decodeFile(uiState.selfieToConfirm!!.absolutePath) + .asImageBitmap(), + ), + confirmButtonText = + stringResource( + R.string.si_smart_selfie_confirmation_dialog_confirm_button, + ), + onConfirm = { + viewModel.submitJob() + }, + retakeButtonText = + stringResource( + R.string.si_smart_selfie_confirmation_dialog_retake_button, + ), + onRetake = viewModel::onSelfieRejected, + scaleFactor = 1.25f, + ) + } else { + viewModel.submitJob() + } + } + + @Composable + private fun HandleProcessingState(viewModel: SelfieViewModel) { + viewModel.onFinished { res -> + val intent = Intent() + when (res) { + is SmileIDResult.Success -> { + intent.putExtra("selfieFile", res.data.selfieFile.absolutePath) + intent.putStringArrayListExtra( + "livenessFiles", + res.data.livenessFiles.pathList(), + ) + + setResult(RESULT_OK, intent) + finish() + } + + is SmileIDResult.Error -> { + intent.putExtra("error", res.throwable.message) + setResult(RESULT_CANCELED, intent) + finish() + } + } + } + } + + + companion object { + const val REQUEST_CODE = 19 + } +} \ No newline at end of file diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieAuthenticationActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieAuthenticationActivity.kt new file mode 100644 index 00000000..acfaca8c --- /dev/null +++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieAuthenticationActivity.kt @@ -0,0 +1,70 @@ +package com.smileidentity.flutter + +import android.content.Intent +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import com.smileidentity.SmileID +import com.smileidentity.compose.SmartSelfieAuthentication +import com.smileidentity.results.SmileIDResult +import com.smileidentity.util.randomUserId +import kotlinx.collections.immutable.toImmutableMap + +class SmileIDSmartSelfieAuthenticationActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val userId = intent.getStringExtra("userId") ?: randomUserId() + val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false) + val allowAgentMode = intent.getBooleanExtra("allowAgentMode", false) + val showAttribution = intent.getBooleanExtra("showAttribution", true) + val showInstructions = intent.getBooleanExtra("showInstructions", true) + val skipApiSubmission = intent.getBooleanExtra("skipApiSubmission", false) + val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams") + val extraPartnerParams = + extraPartnerParamsBundle?.keySet()?.associateWith { + extraPartnerParamsBundle.getString(it) + } as? Map ?: emptyMap() + + setContent { + SmileID.SmartSelfieAuthentication( + userId = userId, + allowNewEnroll = allowNewEnroll, + allowAgentMode = allowAgentMode, + showAttribution = showAttribution, + showInstructions = showInstructions, + skipApiSubmission = skipApiSubmission, + extraPartnerParams = extraPartnerParams.toImmutableMap(), + ) { + val intent = Intent() + when (it) { + is SmileIDResult.Success -> { + intent.putExtra("selfieFile", it.data.selfieFile.absolutePath) + intent.putStringArrayListExtra( + "livenessFiles", + it.data.livenessFiles.pathList(), + ) + + intent.putExtra( + "apiResponse", + it.data.apiResponse?.buildBundle(), + ) + + setResult(RESULT_OK, intent) + finish() + } + + is SmileIDResult.Error -> { + intent.putExtra("error", it.throwable.message) + setResult(RESULT_CANCELED, intent) + finish() + } + } + } + } + } + + companion object { + const val REQUEST_CODE = 13 + } +} diff --git a/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieEnrollmentActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieEnrollmentActivity.kt new file mode 100644 index 00000000..ee30068d --- /dev/null +++ b/android/src/main/kotlin/com/smileidentity/flutter/SmileIDSmartSelfieEnrollmentActivity.kt @@ -0,0 +1,70 @@ +package com.smileidentity.flutter + +import android.content.Intent +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import com.smileidentity.SmileID +import com.smileidentity.compose.SmartSelfieEnrollment +import com.smileidentity.results.SmileIDResult +import com.smileidentity.util.randomUserId +import kotlinx.collections.immutable.toImmutableMap + +class SmileIDSmartSelfieEnrollmentActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val userId = intent.getStringExtra("userId") ?: randomUserId() + val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false) + val allowAgentMode = intent.getBooleanExtra("allowAgentMode", false) + val showAttribution = intent.getBooleanExtra("showAttribution", true) + val showInstructions = intent.getBooleanExtra("showInstructions", true) + val skipApiSubmission = intent.getBooleanExtra("skipApiSubmission", false) + val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams") + val extraPartnerParams = + extraPartnerParamsBundle?.keySet()?.associateWith { + extraPartnerParamsBundle.getString(it) + } as? Map ?: emptyMap() + + setContent { + SmileID.SmartSelfieEnrollment( + userId = userId, + allowNewEnroll = allowNewEnroll, + allowAgentMode = allowAgentMode, + showAttribution = showAttribution, + showInstructions = showInstructions, + skipApiSubmission = skipApiSubmission, + extraPartnerParams = extraPartnerParams.toImmutableMap(), + ) { + val intent = Intent() + when (it) { + is SmileIDResult.Success -> { + intent.putExtra("selfieFile", it.data.selfieFile.absolutePath) + intent.putStringArrayListExtra( + "livenessFiles", + it.data.livenessFiles.pathList(), + ) + + intent.putExtra( + "apiResponse", + it.data.apiResponse?.buildBundle(), + ) + + setResult(RESULT_OK, intent) + finish() + } + + is SmileIDResult.Error -> { + intent.putExtra("error", it.throwable.message) + setResult(RESULT_CANCELED, intent) + finish() + } + } + } + } + } + + companion object { + const val REQUEST_CODE = 12 + } +} diff --git a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhanced.kt b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhanced.kt index c719c28a..6fb0080e 100644 --- a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhanced.kt +++ b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhanced.kt @@ -37,7 +37,8 @@ internal class SmileIDSmartSelfieAuthenticationEnhanced private constructor( extraPartnerParams = extraPartnerParams.toImmutableMap(), ) { val moshi = - Moshi.Builder() + Moshi + .Builder() .add(FileAdapter) .build() when (it) { diff --git a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhancedActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhancedActivity.kt new file mode 100644 index 00000000..fc352a23 --- /dev/null +++ b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieAuthenticationEnhancedActivity.kt @@ -0,0 +1,64 @@ +package com.smileidentity.flutter.enhanced + +import android.content.Intent +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import com.smileidentity.SmileID +import com.smileidentity.compose.SmartSelfieAuthenticationEnhanced +import com.smileidentity.flutter.buildBundle +import com.smileidentity.flutter.pathList +import com.smileidentity.results.SmileIDResult +import com.smileidentity.util.randomUserId +import kotlinx.collections.immutable.toImmutableMap + +class SmileIDSmartSelfieAuthenticationEnhancedActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val userId = intent.getStringExtra("userId") ?: randomUserId() + val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false) + val showAttribution = intent.getBooleanExtra("showAttribution", true) + val showInstructions = intent.getBooleanExtra("showInstructions", true) + val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams") + val extraPartnerParams = + extraPartnerParamsBundle?.keySet()?.associateWith { + extraPartnerParamsBundle.getString(it) + } as? Map ?: emptyMap() + + setContent { + SmileID.SmartSelfieAuthenticationEnhanced( + userId = userId, + allowNewEnroll = allowNewEnroll, + showAttribution = showAttribution, + showInstructions = showInstructions, + extraPartnerParams = extraPartnerParams.toImmutableMap(), + ) { + val intent = Intent() + when (it) { + is SmileIDResult.Success -> { + intent.putExtra("selfieFile", it.data.selfieFile.absolutePath) + intent.putStringArrayListExtra( + "livenessFiles", + it.data.livenessFiles.pathList(), + ) + intent.putExtra("apiResponse", it.data.apiResponse?.buildBundle()) + + setResult(RESULT_OK, intent) + finish() + } + + is SmileIDResult.Error -> { + intent.putExtra("error", it.throwable.message) + setResult(RESULT_CANCELED, intent) + finish() + } + } + } + } + } + + companion object { + const val REQUEST_CODE = 15 + } +} diff --git a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhanced.kt b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhanced.kt index 8ff721c9..7ff81b44 100644 --- a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhanced.kt +++ b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhanced.kt @@ -37,7 +37,8 @@ internal class SmileIDSmartSelfieEnrollmentEnhanced private constructor( extraPartnerParams = extraPartnerParams.toImmutableMap(), ) { val moshi = - Moshi.Builder() + Moshi + .Builder() .add(FileAdapter) .build() when (it) { diff --git a/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhancedActivity.kt b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhancedActivity.kt new file mode 100644 index 00000000..03d4ab71 --- /dev/null +++ b/android/src/main/kotlin/com/smileidentity/flutter/enhanced/SmileIDSmartSelfieEnrollmentEnhancedActivity.kt @@ -0,0 +1,63 @@ +package com.smileidentity.flutter.enhanced + +import android.content.Intent +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import com.smileidentity.SmileID +import com.smileidentity.compose.SmartSelfieEnrollmentEnhanced +import com.smileidentity.flutter.buildBundle +import com.smileidentity.flutter.pathList +import com.smileidentity.results.SmileIDResult +import com.smileidentity.util.randomUserId +import kotlinx.collections.immutable.toImmutableMap + +class SmileIDSmartSelfieEnrollmentEnhancedActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + val userId = intent.getStringExtra("userId") ?: randomUserId() + val allowNewEnroll = intent.getBooleanExtra("allowNewEnroll", false) + val showAttribution = intent.getBooleanExtra("showAttribution", true) + val showInstructions = intent.getBooleanExtra("showInstructions", true) + val extraPartnerParamsBundle = intent.getBundleExtra("extraPartnerParams") + val extraPartnerParams = + extraPartnerParamsBundle?.keySet()?.associateWith { + extraPartnerParamsBundle.getString(it) + } as? Map ?: emptyMap() + + setContent { + SmileID.SmartSelfieEnrollmentEnhanced( + userId = userId, + allowNewEnroll = allowNewEnroll, + showAttribution = showAttribution, + showInstructions = showInstructions, + extraPartnerParams = extraPartnerParams.toImmutableMap(), + ) { + val intent = Intent() + when (it) { + is SmileIDResult.Success -> { + intent.putExtra("selfieFile", it.data.selfieFile.absolutePath) + intent.putStringArrayListExtra( + "livenessFiles", + it.data.livenessFiles.pathList(), + ) + intent.putExtra("apiResponse", it.data.apiResponse?.buildBundle()) + + setResult(RESULT_OK, intent) + finish() + } + + is SmileIDResult.Error -> { + intent.putExtra("error", it.throwable.message) + setResult(RESULT_CANCELED, intent) + finish() + } + } + } + } + } + + companion object { + const val REQUEST_CODE = 14 + } +} diff --git a/android/src/main/kotlin/com/smileidentity/flutter/generated/SmileIDMessages.g.kt b/android/src/main/kotlin/com/smileidentity/flutter/generated/SmileIDMessages.g.kt index 10e57714..b16ae75f 100644 --- a/android/src/main/kotlin/com/smileidentity/flutter/generated/SmileIDMessages.g.kt +++ b/android/src/main/kotlin/com/smileidentity/flutter/generated/SmileIDMessages.g.kt @@ -1,11 +1,14 @@ -// Autogenerated from Pigeon (v16.0.5), do not edit directly. +// Autogenerated from Pigeon (v22.7.1), do not edit directly. // See also: https://pub.dev/packages/pigeon +@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") import android.util.Log import io.flutter.plugin.common.BasicMessageChannel import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.MessageCodec +import io.flutter.plugin.common.StandardMethodCodec import io.flutter.plugin.common.StandardMessageCodec import java.io.ByteArrayOutputStream import java.nio.ByteBuffer @@ -15,14 +18,14 @@ private fun wrapResult(result: Any?): List { } private fun wrapError(exception: Throwable): List { - if (exception is SmileFlutterError) { - return listOf( + return if (exception is SmileFlutterError) { + listOf( exception.code, exception.message, exception.details ) } else { - return listOf( + listOf( exception.javaClass.simpleName, exception.toString(), "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) @@ -43,12 +46,12 @@ class SmileFlutterError ( ) : Throwable() enum class FlutterJobType(val raw: Int) { - ENHANCEDKYC(0), - DOCUMENTVERIFICATION(1), - BIOMETRICKYC(2), - ENHANCEDDOCUMENTVERIFICATION(3), - SMARTSELFIEENROLLMENT(4), - SMARTSELFIEAUTHENTICATION(5); + ENHANCED_KYC(0), + DOCUMENT_VERIFICATION(1), + BIOMETRIC_KYC(2), + ENHANCED_DOCUMENT_VERIFICATION(3), + SMART_SELFIE_ENROLLMENT(4), + SMART_SELFIE_AUTHENTICATION(5); companion object { fun ofRaw(raw: Int): FlutterJobType? { @@ -58,8 +61,8 @@ enum class FlutterJobType(val raw: Int) { } enum class FlutterJobTypeV2(val raw: Int) { - SMARTSELFIEAUTHENTICATION(0), - SMARTSELFIEENROLLMENT(1); + SMART_SELFIE_AUTHENTICATION(0), + SMART_SELFIE_ENROLLMENT(1); companion object { fun ofRaw(raw: Int): FlutterJobTypeV2? { @@ -69,14 +72,14 @@ enum class FlutterJobTypeV2(val raw: Int) { } enum class FlutterImageType(val raw: Int) { - SELFIEJPGFILE(0), - IDCARDJPGFILE(1), - SELFIEJPGBASE64(2), - IDCARDJPGBASE64(3), - LIVENESSJPGFILE(4), - IDCARDREARJPGFILE(5), - LIVENESSJPGBASE64(6), - IDCARDREARJPGBASE64(7); + SELFIE_JPG_FILE(0), + ID_CARD_JPG_FILE(1), + SELFIE_JPG_BASE64(2), + ID_CARD_JPG_BASE64(3), + LIVENESS_JPG_FILE(4), + ID_CARD_REAR_JPG_FILE(5), + LIVENESS_JPG_BASE64(6), + ID_CARD_REAR_JPG_BASE64(7); companion object { fun ofRaw(raw: Int): FlutterImageType? { @@ -90,19 +93,19 @@ enum class FlutterActionResult(val raw: Int) { COMPLETED(1), APPROVED(2), VERIFIED(3), - PROVISIONALLYAPPROVED(4), + PROVISIONALLY_APPROVED(4), RETURNED(5), - NOTRETURNED(6), + NOT_RETURNED(6), FAILED(7), REJECTED(8), - UNDERREVIEW(9), - UNABLETODETERMINE(10), - NOTAPPLICABLE(11), - NOTVERIFIED(12), - NOTDONE(13), - ISSUERUNAVAILABLE(14), - IDAUTHORITYPHOTONOTAVAILABLE(15), - SENTTOHUMANREVIEW(16), + UNDER_REVIEW(9), + UNABLE_TO_DETERMINE(10), + NOT_APPLICABLE(11), + NOT_VERIFIED(12), + NOT_DONE(13), + ISSUER_UNAVAILABLE(14), + ID_AUTHORITY_PHOTO_NOT_AVAILABLE(15), + SENT_TO_HUMAN_REVIEW(16), UNKNOWN(17); companion object { @@ -135,23 +138,20 @@ data class FlutterPartnerParams ( val jobId: String, val userId: String, val extras: Map? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterPartnerParams { - val jobType: FlutterJobType? = (list[0] as Int?)?.let { - FlutterJobType.ofRaw(it) - } - val jobId = list[1] as String - val userId = list[2] as String - val extras = list[3] as Map? + fun fromList(pigeonVar_list: List): FlutterPartnerParams { + val jobType = pigeonVar_list[0] as FlutterJobType? + val jobId = pigeonVar_list[1] as String + val userId = pigeonVar_list[2] as String + val extras = pigeonVar_list[3] as Map? return FlutterPartnerParams(jobType, jobId, userId, extras) } } fun toList(): List { - return listOf( - jobType?.raw, + return listOf( + jobType, jobId, userId, extras, @@ -159,6 +159,390 @@ data class FlutterPartnerParams ( } } +/** Generated class from Pigeon that represents data sent in messages. */ +data class SmartSelfieCreationParams ( + val userId: String? = null, + val allowNewEnroll: Boolean, + val allowAgentMode: Boolean, + val showAttribution: Boolean, + val showInstructions: Boolean, + val skipApiSubmission: Boolean, + val extraPartnerParams: Map? = null +) + { + companion object { + fun fromList(pigeonVar_list: List): SmartSelfieCreationParams { + val userId = pigeonVar_list[0] as String? + val allowNewEnroll = pigeonVar_list[1] as Boolean + val allowAgentMode = pigeonVar_list[2] as Boolean + val showAttribution = pigeonVar_list[3] as Boolean + val showInstructions = pigeonVar_list[4] as Boolean + val skipApiSubmission = pigeonVar_list[5] as Boolean + val extraPartnerParams = pigeonVar_list[6] as Map? + return SmartSelfieCreationParams(userId, allowNewEnroll, allowAgentMode, showAttribution, showInstructions, skipApiSubmission, extraPartnerParams) + } + } + fun toList(): List { + return listOf( + userId, + allowNewEnroll, + allowAgentMode, + showAttribution, + showInstructions, + skipApiSubmission, + extraPartnerParams, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class SmartSelfieEnhancedCreationParams ( + val userId: String? = null, + val allowNewEnroll: Boolean, + val showAttribution: Boolean, + val showInstructions: Boolean, + val extraPartnerParams: Map? = null +) + { + companion object { + fun fromList(pigeonVar_list: List): SmartSelfieEnhancedCreationParams { + val userId = pigeonVar_list[0] as String? + val allowNewEnroll = pigeonVar_list[1] as Boolean + val showAttribution = pigeonVar_list[2] as Boolean + val showInstructions = pigeonVar_list[3] as Boolean + val extraPartnerParams = pigeonVar_list[4] as Map? + return SmartSelfieEnhancedCreationParams(userId, allowNewEnroll, showAttribution, showInstructions, extraPartnerParams) + } + } + fun toList(): List { + return listOf( + userId, + allowNewEnroll, + showAttribution, + showInstructions, + extraPartnerParams, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class SmartSelfieCaptureResult ( + val selfieFile: String? = null, + val livenessFiles: List? = null, + val apiResponse: Map? = null +) + { + companion object { + fun fromList(pigeonVar_list: List): SmartSelfieCaptureResult { + val selfieFile = pigeonVar_list[0] as String? + val livenessFiles = pigeonVar_list[1] as List? + val apiResponse = pigeonVar_list[2] as Map? + return SmartSelfieCaptureResult(selfieFile, livenessFiles, apiResponse) + } + } + fun toList(): List { + return listOf( + selfieFile, + livenessFiles, + apiResponse, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class DocumentVerificationCreationParams ( + val countryCode: String, + val documentType: String? = null, + val idAspectRatio: Double? = null, + val captureBothSides: Boolean, + val bypassSelfieCaptureWithFile: String? = null, + val userId: String? = null, + val jobId: String? = null, + val allowNewEnroll: Boolean, + val showAttribution: Boolean, + val allowGalleryUpload: Boolean, + val allowAgentMode: Boolean, + val showInstructions: Boolean, + val skipApiSubmission: Boolean, + val extraPartnerParams: Map? = null +) + { + companion object { + fun fromList(pigeonVar_list: List): DocumentVerificationCreationParams { + val countryCode = pigeonVar_list[0] as String + val documentType = pigeonVar_list[1] as String? + val idAspectRatio = pigeonVar_list[2] as Double? + val captureBothSides = pigeonVar_list[3] as Boolean + val bypassSelfieCaptureWithFile = pigeonVar_list[4] as String? + val userId = pigeonVar_list[5] as String? + val jobId = pigeonVar_list[6] as String? + val allowNewEnroll = pigeonVar_list[7] as Boolean + val showAttribution = pigeonVar_list[8] as Boolean + val allowGalleryUpload = pigeonVar_list[9] as Boolean + val allowAgentMode = pigeonVar_list[10] as Boolean + val showInstructions = pigeonVar_list[11] as Boolean + val skipApiSubmission = pigeonVar_list[12] as Boolean + val extraPartnerParams = pigeonVar_list[13] as Map? + return DocumentVerificationCreationParams(countryCode, documentType, idAspectRatio, captureBothSides, bypassSelfieCaptureWithFile, userId, jobId, allowNewEnroll, showAttribution, allowGalleryUpload, allowAgentMode, showInstructions, skipApiSubmission, extraPartnerParams) + } + } + fun toList(): List { + return listOf( + countryCode, + documentType, + idAspectRatio, + captureBothSides, + bypassSelfieCaptureWithFile, + userId, + jobId, + allowNewEnroll, + showAttribution, + allowGalleryUpload, + allowAgentMode, + showInstructions, + skipApiSubmission, + extraPartnerParams, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class DocumentVerificationEnhancedCreationParams ( + val countryCode: String, + val documentType: String? = null, + val idAspectRatio: Double? = null, + val captureBothSides: Boolean, + val bypassSelfieCaptureWithFile: String? = null, + val userId: String? = null, + val jobId: String? = null, + val allowNewEnroll: Boolean, + val showAttribution: Boolean, + val allowAgentMode: Boolean, + val allowGalleryUpload: Boolean, + val showInstructions: Boolean, + val skipApiSubmission: Boolean, + val extraPartnerParams: Map? = null +) + { + companion object { + fun fromList(pigeonVar_list: List): DocumentVerificationEnhancedCreationParams { + val countryCode = pigeonVar_list[0] as String + val documentType = pigeonVar_list[1] as String? + val idAspectRatio = pigeonVar_list[2] as Double? + val captureBothSides = pigeonVar_list[3] as Boolean + val bypassSelfieCaptureWithFile = pigeonVar_list[4] as String? + val userId = pigeonVar_list[5] as String? + val jobId = pigeonVar_list[6] as String? + val allowNewEnroll = pigeonVar_list[7] as Boolean + val showAttribution = pigeonVar_list[8] as Boolean + val allowAgentMode = pigeonVar_list[9] as Boolean + val allowGalleryUpload = pigeonVar_list[10] as Boolean + val showInstructions = pigeonVar_list[11] as Boolean + val skipApiSubmission = pigeonVar_list[12] as Boolean + val extraPartnerParams = pigeonVar_list[13] as Map? + return DocumentVerificationEnhancedCreationParams(countryCode, documentType, idAspectRatio, captureBothSides, bypassSelfieCaptureWithFile, userId, jobId, allowNewEnroll, showAttribution, allowAgentMode, allowGalleryUpload, showInstructions, skipApiSubmission, extraPartnerParams) + } + } + fun toList(): List { + return listOf( + countryCode, + documentType, + idAspectRatio, + captureBothSides, + bypassSelfieCaptureWithFile, + userId, + jobId, + allowNewEnroll, + showAttribution, + allowAgentMode, + allowGalleryUpload, + showInstructions, + skipApiSubmission, + extraPartnerParams, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class DocumentCaptureResult ( + val selfieFile: String? = null, + val documentFrontFile: String? = null, + val livenessFiles: List? = null, + val documentBackFile: String? = null, + val didSubmitDocumentVerificationJob: Boolean? = null, + val didSubmitEnhancedDocVJob: Boolean? = null +) + { + companion object { + fun fromList(pigeonVar_list: List): DocumentCaptureResult { + val selfieFile = pigeonVar_list[0] as String? + val documentFrontFile = pigeonVar_list[1] as String? + val livenessFiles = pigeonVar_list[2] as List? + val documentBackFile = pigeonVar_list[3] as String? + val didSubmitDocumentVerificationJob = pigeonVar_list[4] as Boolean? + val didSubmitEnhancedDocVJob = pigeonVar_list[5] as Boolean? + return DocumentCaptureResult(selfieFile, documentFrontFile, livenessFiles, documentBackFile, didSubmitDocumentVerificationJob, didSubmitEnhancedDocVJob) + } + } + fun toList(): List { + return listOf( + selfieFile, + documentFrontFile, + livenessFiles, + documentBackFile, + didSubmitDocumentVerificationJob, + didSubmitEnhancedDocVJob, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class BiometricKYCCreationParams ( + val country: String? = null, + val idType: String? = null, + val idNumber: String? = null, + val firstName: String? = null, + val middleName: String? = null, + val lastName: String? = null, + val dob: String? = null, + val bankCode: String? = null, + val entered: Boolean? = null, + val userId: String? = null, + val jobId: String? = null, + val allowNewEnroll: Boolean, + val allowAgentMode: Boolean, + val showAttribution: Boolean, + val showInstructions: Boolean, + val extraPartnerParams: Map? = null +) + { + companion object { + fun fromList(pigeonVar_list: List): BiometricKYCCreationParams { + val country = pigeonVar_list[0] as String? + val idType = pigeonVar_list[1] as String? + val idNumber = pigeonVar_list[2] as String? + val firstName = pigeonVar_list[3] as String? + val middleName = pigeonVar_list[4] as String? + val lastName = pigeonVar_list[5] as String? + val dob = pigeonVar_list[6] as String? + val bankCode = pigeonVar_list[7] as String? + val entered = pigeonVar_list[8] as Boolean? + val userId = pigeonVar_list[9] as String? + val jobId = pigeonVar_list[10] as String? + val allowNewEnroll = pigeonVar_list[11] as Boolean + val allowAgentMode = pigeonVar_list[12] as Boolean + val showAttribution = pigeonVar_list[13] as Boolean + val showInstructions = pigeonVar_list[14] as Boolean + val extraPartnerParams = pigeonVar_list[15] as Map? + return BiometricKYCCreationParams(country, idType, idNumber, firstName, middleName, lastName, dob, bankCode, entered, userId, jobId, allowNewEnroll, allowAgentMode, showAttribution, showInstructions, extraPartnerParams) + } + } + fun toList(): List { + return listOf( + country, + idType, + idNumber, + firstName, + middleName, + lastName, + dob, + bankCode, + entered, + userId, + jobId, + allowNewEnroll, + allowAgentMode, + showAttribution, + showInstructions, + extraPartnerParams, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class BiometricKYCCaptureResult ( + val selfieFile: String? = null, + val livenessFiles: List? = null, + val didSubmitBiometricKycJob: Boolean? = null +) + { + companion object { + fun fromList(pigeonVar_list: List): BiometricKYCCaptureResult { + val selfieFile = pigeonVar_list[0] as String? + val livenessFiles = pigeonVar_list[1] as List? + val didSubmitBiometricKycJob = pigeonVar_list[2] as Boolean? + return BiometricKYCCaptureResult(selfieFile, livenessFiles, didSubmitBiometricKycJob) + } + } + fun toList(): List { + return listOf( + selfieFile, + livenessFiles, + didSubmitBiometricKycJob, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class SelfieCaptureViewCreationParams ( + val showConfirmationDialog: Boolean, + val showInstructions: Boolean, + val showAttribution: Boolean, + val allowAgentMode: Boolean +) + { + companion object { + fun fromList(pigeonVar_list: List): SelfieCaptureViewCreationParams { + val showConfirmationDialog = pigeonVar_list[0] as Boolean + val showInstructions = pigeonVar_list[1] as Boolean + val showAttribution = pigeonVar_list[2] as Boolean + val allowAgentMode = pigeonVar_list[3] as Boolean + return SelfieCaptureViewCreationParams(showConfirmationDialog, showInstructions, showAttribution, allowAgentMode) + } + } + fun toList(): List { + return listOf( + showConfirmationDialog, + showInstructions, + showAttribution, + allowAgentMode, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class DocumentCaptureCreationParams ( + val isDocumentFrontSide: Boolean, + val showInstructions: Boolean, + val showAttribution: Boolean, + val allowGalleryUpload: Boolean, + val showConfirmationDialog: Boolean, + val idAspectRatio: Double? = null +) + { + companion object { + fun fromList(pigeonVar_list: List): DocumentCaptureCreationParams { + val isDocumentFrontSide = pigeonVar_list[0] as Boolean + val showInstructions = pigeonVar_list[1] as Boolean + val showAttribution = pigeonVar_list[2] as Boolean + val allowGalleryUpload = pigeonVar_list[3] as Boolean + val showConfirmationDialog = pigeonVar_list[4] as Boolean + val idAspectRatio = pigeonVar_list[5] as Double? + return DocumentCaptureCreationParams(isDocumentFrontSide, showInstructions, showAttribution, allowGalleryUpload, showConfirmationDialog, idAspectRatio) + } + } + fun toList(): List { + return listOf( + isDocumentFrontSide, + showInstructions, + showAttribution, + allowGalleryUpload, + showConfirmationDialog, + idAspectRatio, + ) + } +} + /** * The Auth Smile request. Auth Smile serves multiple purposes: * @@ -187,23 +571,22 @@ data class FlutterAuthenticationRequest ( val updateEnrolledImage: Boolean? = null, val jobId: String? = null, val userId: String? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterAuthenticationRequest { - val jobType = FlutterJobType.ofRaw(list[0] as Int)!! - val country = list[1] as String? - val idType = list[2] as String? - val updateEnrolledImage = list[3] as Boolean? - val jobId = list[4] as String? - val userId = list[5] as String? + fun fromList(pigeonVar_list: List): FlutterAuthenticationRequest { + val jobType = pigeonVar_list[0] as FlutterJobType + val country = pigeonVar_list[1] as String? + val idType = pigeonVar_list[2] as String? + val updateEnrolledImage = pigeonVar_list[3] as Boolean? + val jobId = pigeonVar_list[4] as String? + val userId = pigeonVar_list[5] as String? return FlutterAuthenticationRequest(jobType, country, idType, updateEnrolledImage, jobId, userId) } } fun toList(): List { - return listOf( - jobType.raw, + return listOf( + jobType, country, idType, updateEnrolledImage, @@ -230,30 +613,27 @@ data class FlutterAuthenticationResponse ( val partnerParams: FlutterPartnerParams, val callbackUrl: String? = null, val consentInfo: FlutterConsentInfo? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterAuthenticationResponse { - val success = list[0] as Boolean - val signature = list[1] as String - val timestamp = list[2] as String - val partnerParams = FlutterPartnerParams.fromList(list[3] as List) - val callbackUrl = list[4] as String? - val consentInfo: FlutterConsentInfo? = (list[5] as List?)?.let { - FlutterConsentInfo.fromList(it) - } + fun fromList(pigeonVar_list: List): FlutterAuthenticationResponse { + val success = pigeonVar_list[0] as Boolean + val signature = pigeonVar_list[1] as String + val timestamp = pigeonVar_list[2] as String + val partnerParams = pigeonVar_list[3] as FlutterPartnerParams + val callbackUrl = pigeonVar_list[4] as String? + val consentInfo = pigeonVar_list[5] as FlutterConsentInfo? return FlutterAuthenticationResponse(success, signature, timestamp, partnerParams, callbackUrl, consentInfo) } } fun toList(): List { - return listOf( + return listOf( success, signature, timestamp, - partnerParams.toList(), + partnerParams, callbackUrl, - consentInfo?.toList(), + consentInfo, ) } } @@ -266,23 +646,22 @@ data class FlutterPrepUploadRequest ( val partnerId: String, val timestamp: String, val signature: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterPrepUploadRequest { - val partnerParams = FlutterPartnerParams.fromList(list[0] as List) - val callbackUrl = list[1] as String? - val allowNewEnroll = list[2] as Boolean - val partnerId = list[3] as String - val timestamp = list[4] as String - val signature = list[5] as String + fun fromList(pigeonVar_list: List): FlutterPrepUploadRequest { + val partnerParams = pigeonVar_list[0] as FlutterPartnerParams + val callbackUrl = pigeonVar_list[1] as String? + val allowNewEnroll = pigeonVar_list[2] as Boolean + val partnerId = pigeonVar_list[3] as String + val timestamp = pigeonVar_list[4] as String + val signature = pigeonVar_list[5] as String return FlutterPrepUploadRequest(partnerParams, callbackUrl, allowNewEnroll, partnerId, timestamp, signature) } } fun toList(): List { - return listOf( - partnerParams.toList(), + return listOf( + partnerParams, callbackUrl, allowNewEnroll, partnerId, @@ -298,20 +677,19 @@ data class FlutterPrepUploadResponse ( val refId: String, val uploadUrl: String, val smileJobId: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterPrepUploadResponse { - val code = list[0] as String - val refId = list[1] as String - val uploadUrl = list[2] as String - val smileJobId = list[3] as String + fun fromList(pigeonVar_list: List): FlutterPrepUploadResponse { + val code = pigeonVar_list[0] as String + val refId = pigeonVar_list[1] as String + val uploadUrl = pigeonVar_list[2] as String + val smileJobId = pigeonVar_list[3] as String return FlutterPrepUploadResponse(code, refId, uploadUrl, smileJobId) } } fun toList(): List { - return listOf( + return listOf( code, refId, uploadUrl, @@ -324,22 +702,19 @@ data class FlutterPrepUploadResponse ( data class FlutterUploadRequest ( val images: List, val idInfo: FlutterIdInfo? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterUploadRequest { - val images = list[0] as List - val idInfo: FlutterIdInfo? = (list[1] as List?)?.let { - FlutterIdInfo.fromList(it) - } + fun fromList(pigeonVar_list: List): FlutterUploadRequest { + val images = pigeonVar_list[0] as List + val idInfo = pigeonVar_list[1] as FlutterIdInfo? return FlutterUploadRequest(images, idInfo) } } fun toList(): List { - return listOf( + return listOf( images, - idInfo?.toList(), + idInfo, ) } } @@ -348,19 +723,18 @@ data class FlutterUploadRequest ( data class FlutterUploadImageInfo ( val imageTypeId: FlutterImageType, val imageName: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterUploadImageInfo { - val imageTypeId = FlutterImageType.ofRaw(list[0] as Int)!! - val imageName = list[1] as String + fun fromList(pigeonVar_list: List): FlutterUploadImageInfo { + val imageTypeId = pigeonVar_list[0] as FlutterImageType + val imageName = pigeonVar_list[1] as String return FlutterUploadImageInfo(imageTypeId, imageName) } } fun toList(): List { - return listOf( - imageTypeId.raw, + return listOf( + imageTypeId, imageName, ) } @@ -377,25 +751,24 @@ data class FlutterIdInfo ( val dob: String? = null, val bankCode: String? = null, val entered: Boolean? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterIdInfo { - val country = list[0] as String - val idType = list[1] as String? - val idNumber = list[2] as String? - val firstName = list[3] as String? - val middleName = list[4] as String? - val lastName = list[5] as String? - val dob = list[6] as String? - val bankCode = list[7] as String? - val entered = list[8] as Boolean? + fun fromList(pigeonVar_list: List): FlutterIdInfo { + val country = pigeonVar_list[0] as String + val idType = pigeonVar_list[1] as String? + val idNumber = pigeonVar_list[2] as String? + val firstName = pigeonVar_list[3] as String? + val middleName = pigeonVar_list[4] as String? + val lastName = pigeonVar_list[5] as String? + val dob = pigeonVar_list[6] as String? + val bankCode = pigeonVar_list[7] as String? + val entered = pigeonVar_list[8] as Boolean? return FlutterIdInfo(country, idType, idNumber, firstName, middleName, lastName, dob, bankCode, entered) } } fun toList(): List { - return listOf( + return listOf( country, idType, idNumber, @@ -423,33 +796,32 @@ data class FlutterEnhancedKycResponse ( val expirationDate: String? = null, val dob: String? = null, val base64Photo: String? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterEnhancedKycResponse { - val smileJobId = list[0] as String - val partnerParams = FlutterPartnerParams.fromList(list[1] as List) - val resultText = list[2] as String - val resultCode = list[3] as String - val actions = FlutterActions.fromList(list[4] as List) - val country = list[5] as String - val idType = list[6] as String - val idNumber = list[7] as String - val fullName = list[8] as String? - val expirationDate = list[9] as String? - val dob = list[10] as String? - val base64Photo = list[11] as String? + fun fromList(pigeonVar_list: List): FlutterEnhancedKycResponse { + val smileJobId = pigeonVar_list[0] as String + val partnerParams = pigeonVar_list[1] as FlutterPartnerParams + val resultText = pigeonVar_list[2] as String + val resultCode = pigeonVar_list[3] as String + val actions = pigeonVar_list[4] as FlutterActions + val country = pigeonVar_list[5] as String + val idType = pigeonVar_list[6] as String + val idNumber = pigeonVar_list[7] as String + val fullName = pigeonVar_list[8] as String? + val expirationDate = pigeonVar_list[9] as String? + val dob = pigeonVar_list[10] as String? + val base64Photo = pigeonVar_list[11] as String? return FlutterEnhancedKycResponse(smileJobId, partnerParams, resultText, resultCode, actions, country, idType, idNumber, fullName, expirationDate, dob, base64Photo) } } fun toList(): List { - return listOf( + return listOf( smileJobId, - partnerParams.toList(), + partnerParams, resultText, resultCode, - actions.toList(), + actions, country, idType, idNumber, @@ -480,50 +852,49 @@ data class FlutterActions ( val updateRegisteredSelfieOnFile: FlutterActionResult, val verifyDocument: FlutterActionResult, val verifyIdNumber: FlutterActionResult - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterActions { - val documentCheck = FlutterActionResult.ofRaw(list[0] as Int)!! - val humanReviewCompare = FlutterActionResult.ofRaw(list[1] as Int)!! - val humanReviewDocumentCheck = FlutterActionResult.ofRaw(list[2] as Int)!! - val humanReviewLivenessCheck = FlutterActionResult.ofRaw(list[3] as Int)!! - val humanReviewSelfieCheck = FlutterActionResult.ofRaw(list[4] as Int)!! - val humanReviewUpdateSelfie = FlutterActionResult.ofRaw(list[5] as Int)!! - val livenessCheck = FlutterActionResult.ofRaw(list[6] as Int)!! - val registerSelfie = FlutterActionResult.ofRaw(list[7] as Int)!! - val returnPersonalInfo = FlutterActionResult.ofRaw(list[8] as Int)!! - val selfieCheck = FlutterActionResult.ofRaw(list[9] as Int)!! - val selfieProvided = FlutterActionResult.ofRaw(list[10] as Int)!! - val selfieToIdAuthorityCompare = FlutterActionResult.ofRaw(list[11] as Int)!! - val selfieToIdCardCompare = FlutterActionResult.ofRaw(list[12] as Int)!! - val selfieToRegisteredSelfieCompare = FlutterActionResult.ofRaw(list[13] as Int)!! - val updateRegisteredSelfieOnFile = FlutterActionResult.ofRaw(list[14] as Int)!! - val verifyDocument = FlutterActionResult.ofRaw(list[15] as Int)!! - val verifyIdNumber = FlutterActionResult.ofRaw(list[16] as Int)!! + fun fromList(pigeonVar_list: List): FlutterActions { + val documentCheck = pigeonVar_list[0] as FlutterActionResult + val humanReviewCompare = pigeonVar_list[1] as FlutterActionResult + val humanReviewDocumentCheck = pigeonVar_list[2] as FlutterActionResult + val humanReviewLivenessCheck = pigeonVar_list[3] as FlutterActionResult + val humanReviewSelfieCheck = pigeonVar_list[4] as FlutterActionResult + val humanReviewUpdateSelfie = pigeonVar_list[5] as FlutterActionResult + val livenessCheck = pigeonVar_list[6] as FlutterActionResult + val registerSelfie = pigeonVar_list[7] as FlutterActionResult + val returnPersonalInfo = pigeonVar_list[8] as FlutterActionResult + val selfieCheck = pigeonVar_list[9] as FlutterActionResult + val selfieProvided = pigeonVar_list[10] as FlutterActionResult + val selfieToIdAuthorityCompare = pigeonVar_list[11] as FlutterActionResult + val selfieToIdCardCompare = pigeonVar_list[12] as FlutterActionResult + val selfieToRegisteredSelfieCompare = pigeonVar_list[13] as FlutterActionResult + val updateRegisteredSelfieOnFile = pigeonVar_list[14] as FlutterActionResult + val verifyDocument = pigeonVar_list[15] as FlutterActionResult + val verifyIdNumber = pigeonVar_list[16] as FlutterActionResult return FlutterActions(documentCheck, humanReviewCompare, humanReviewDocumentCheck, humanReviewLivenessCheck, humanReviewSelfieCheck, humanReviewUpdateSelfie, livenessCheck, registerSelfie, returnPersonalInfo, selfieCheck, selfieProvided, selfieToIdAuthorityCompare, selfieToIdCardCompare, selfieToRegisteredSelfieCompare, updateRegisteredSelfieOnFile, verifyDocument, verifyIdNumber) } } fun toList(): List { - return listOf( - documentCheck.raw, - humanReviewCompare.raw, - humanReviewDocumentCheck.raw, - humanReviewLivenessCheck.raw, - humanReviewSelfieCheck.raw, - humanReviewUpdateSelfie.raw, - livenessCheck.raw, - registerSelfie.raw, - returnPersonalInfo.raw, - selfieCheck.raw, - selfieProvided.raw, - selfieToIdAuthorityCompare.raw, - selfieToIdCardCompare.raw, - selfieToRegisteredSelfieCompare.raw, - updateRegisteredSelfieOnFile.raw, - verifyDocument.raw, - verifyIdNumber.raw, + return listOf( + documentCheck, + humanReviewCompare, + humanReviewDocumentCheck, + humanReviewLivenessCheck, + humanReviewSelfieCheck, + humanReviewUpdateSelfie, + livenessCheck, + registerSelfie, + returnPersonalInfo, + selfieCheck, + selfieProvided, + selfieToIdAuthorityCompare, + selfieToIdCardCompare, + selfieToRegisteredSelfieCompare, + updateRegisteredSelfieOnFile, + verifyDocument, + verifyIdNumber, ) } } @@ -537,18 +908,17 @@ data class FlutterActions ( data class FlutterConsentInfo ( val canAccess: Boolean, val consentRequired: Boolean - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterConsentInfo { - val canAccess = list[0] as Boolean - val consentRequired = list[1] as Boolean + fun fromList(pigeonVar_list: List): FlutterConsentInfo { + val canAccess = pigeonVar_list[0] as Boolean + val consentRequired = pigeonVar_list[1] as Boolean return FlutterConsentInfo(canAccess, consentRequired) } } fun toList(): List { - return listOf( + return listOf( canAccess, consentRequired, ) @@ -575,29 +945,28 @@ data class FlutterEnhancedKycRequest ( val partnerParams: FlutterPartnerParams, val timestamp: String, val signature: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterEnhancedKycRequest { - val country = list[0] as String - val idType = list[1] as String - val idNumber = list[2] as String - val firstName = list[3] as String? - val middleName = list[4] as String? - val lastName = list[5] as String? - val dob = list[6] as String? - val phoneNumber = list[7] as String? - val bankCode = list[8] as String? - val callbackUrl = list[9] as String? - val partnerParams = FlutterPartnerParams.fromList(list[10] as List) - val timestamp = list[11] as String - val signature = list[12] as String + fun fromList(pigeonVar_list: List): FlutterEnhancedKycRequest { + val country = pigeonVar_list[0] as String + val idType = pigeonVar_list[1] as String + val idNumber = pigeonVar_list[2] as String + val firstName = pigeonVar_list[3] as String? + val middleName = pigeonVar_list[4] as String? + val lastName = pigeonVar_list[5] as String? + val dob = pigeonVar_list[6] as String? + val phoneNumber = pigeonVar_list[7] as String? + val bankCode = pigeonVar_list[8] as String? + val callbackUrl = pigeonVar_list[9] as String? + val partnerParams = pigeonVar_list[10] as FlutterPartnerParams + val timestamp = pigeonVar_list[11] as String + val signature = pigeonVar_list[12] as String return FlutterEnhancedKycRequest(country, idType, idNumber, firstName, middleName, lastName, dob, phoneNumber, bankCode, callbackUrl, partnerParams, timestamp, signature) } } fun toList(): List { - return listOf( + return listOf( country, idType, idNumber, @@ -608,7 +977,7 @@ data class FlutterEnhancedKycRequest ( phoneNumber, bankCode, callbackUrl, - partnerParams.toList(), + partnerParams, timestamp, signature, ) @@ -618,17 +987,16 @@ data class FlutterEnhancedKycRequest ( /** Generated class from Pigeon that represents data sent in messages. */ data class FlutterEnhancedKycAsyncResponse ( val success: Boolean - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterEnhancedKycAsyncResponse { - val success = list[0] as Boolean + fun fromList(pigeonVar_list: List): FlutterEnhancedKycAsyncResponse { + val success = pigeonVar_list[0] as Boolean return FlutterEnhancedKycAsyncResponse(success) } } fun toList(): List { - return listOf( + return listOf( success, ) } @@ -638,18 +1006,17 @@ data class FlutterEnhancedKycAsyncResponse ( data class FlutterImageLinks ( val selfieImageUrl: String? = null, val error: String? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterImageLinks { - val selfieImageUrl = list[0] as String? - val error = list[1] as String? + fun fromList(pigeonVar_list: List): FlutterImageLinks { + val selfieImageUrl = pigeonVar_list[0] as String? + val error = pigeonVar_list[1] as String? return FlutterImageLinks(selfieImageUrl, error) } } fun toList(): List { - return listOf( + return listOf( selfieImageUrl, error, ) @@ -659,17 +1026,16 @@ data class FlutterImageLinks ( /** Generated class from Pigeon that represents data sent in messages. */ data class FlutterAntifraud ( val suspectUsers: List - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterAntifraud { - val suspectUsers = list[0] as List + fun fromList(pigeonVar_list: List): FlutterAntifraud { + val suspectUsers = pigeonVar_list[0] as List return FlutterAntifraud(suspectUsers) } } fun toList(): List { - return listOf( + return listOf( suspectUsers, ) } @@ -679,18 +1045,17 @@ data class FlutterAntifraud ( data class FlutterSuspectUser ( val reason: String, val userId: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterSuspectUser { - val reason = list[0] as String - val userId = list[1] as String + fun fromList(pigeonVar_list: List): FlutterSuspectUser { + val reason = pigeonVar_list[0] as String + val userId = pigeonVar_list[1] as String return FlutterSuspectUser(reason, userId) } } fun toList(): List { - return listOf( + return listOf( reason, userId, ) @@ -706,23 +1071,22 @@ data class FlutterJobStatusRequest ( val partnerId: String, val timestamp: String, val signature: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterJobStatusRequest { - val userId = list[0] as String - val jobId = list[1] as String - val includeImageLinks = list[2] as Boolean - val includeHistory = list[3] as Boolean - val partnerId = list[4] as String - val timestamp = list[5] as String - val signature = list[6] as String + fun fromList(pigeonVar_list: List): FlutterJobStatusRequest { + val userId = pigeonVar_list[0] as String + val jobId = pigeonVar_list[1] as String + val includeImageLinks = pigeonVar_list[2] as Boolean + val includeHistory = pigeonVar_list[3] as Boolean + val partnerId = pigeonVar_list[4] as String + val timestamp = pigeonVar_list[5] as String + val signature = pigeonVar_list[6] as String return FlutterJobStatusRequest(userId, jobId, includeImageLinks, includeHistory, partnerId, timestamp, signature) } } fun toList(): List { - return listOf( + return listOf( userId, jobId, includeImageLinks, @@ -742,27 +1106,26 @@ data class FlutterSmartSelfieJobResult ( val smileJobId: String, val partnerParams: FlutterPartnerParams, val confidence: Double? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterSmartSelfieJobResult { - val actions = FlutterActions.fromList(list[0] as List) - val resultCode = list[1] as String - val resultText = list[2] as String - val smileJobId = list[3] as String - val partnerParams = FlutterPartnerParams.fromList(list[4] as List) - val confidence = list[5] as Double? + fun fromList(pigeonVar_list: List): FlutterSmartSelfieJobResult { + val actions = pigeonVar_list[0] as FlutterActions + val resultCode = pigeonVar_list[1] as String + val resultText = pigeonVar_list[2] as String + val smileJobId = pigeonVar_list[3] as String + val partnerParams = pigeonVar_list[4] as FlutterPartnerParams + val confidence = pigeonVar_list[5] as Double? return FlutterSmartSelfieJobResult(actions, resultCode, resultText, smileJobId, partnerParams, confidence) } } fun toList(): List { - return listOf( - actions.toList(), + return listOf( + actions, resultCode, resultText, smileJobId, - partnerParams.toList(), + partnerParams, confidence, ) } @@ -778,36 +1141,31 @@ data class FlutterSmartSelfieJobStatusResponse ( val resultString: String? = null, val history: List? = null, val imageLinks: FlutterImageLinks? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterSmartSelfieJobStatusResponse { - val timestamp = list[0] as String - val jobComplete = list[1] as Boolean - val jobSuccess = list[2] as Boolean - val code = list[3] as String - val result: FlutterSmartSelfieJobResult? = (list[4] as List?)?.let { - FlutterSmartSelfieJobResult.fromList(it) - } - val resultString = list[5] as String? - val history = list[6] as List? - val imageLinks: FlutterImageLinks? = (list[7] as List?)?.let { - FlutterImageLinks.fromList(it) - } + fun fromList(pigeonVar_list: List): FlutterSmartSelfieJobStatusResponse { + val timestamp = pigeonVar_list[0] as String + val jobComplete = pigeonVar_list[1] as Boolean + val jobSuccess = pigeonVar_list[2] as Boolean + val code = pigeonVar_list[3] as String + val result = pigeonVar_list[4] as FlutterSmartSelfieJobResult? + val resultString = pigeonVar_list[5] as String? + val history = pigeonVar_list[6] as List? + val imageLinks = pigeonVar_list[7] as FlutterImageLinks? return FlutterSmartSelfieJobStatusResponse(timestamp, jobComplete, jobSuccess, code, result, resultString, history, imageLinks) } } fun toList(): List { - return listOf( + return listOf( timestamp, jobComplete, jobSuccess, code, - result?.toList(), + result, resultString, history, - imageLinks?.toList(), + imageLinks, ) } } @@ -824,34 +1182,33 @@ data class FlutterSmartSelfieResponse ( val status: FlutterSmartSelfieStatus, val updatedAt: String, val userId: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterSmartSelfieResponse { - val code = list[0] as String - val createdAt = list[1] as String - val jobId = list[2] as String - val jobType = FlutterJobTypeV2.ofRaw(list[3] as Int)!! - val message = list[4] as String - val partnerId = list[5] as String - val partnerParams = list[6] as Map? - val status = FlutterSmartSelfieStatus.ofRaw(list[7] as Int)!! - val updatedAt = list[8] as String - val userId = list[9] as String + fun fromList(pigeonVar_list: List): FlutterSmartSelfieResponse { + val code = pigeonVar_list[0] as String + val createdAt = pigeonVar_list[1] as String + val jobId = pigeonVar_list[2] as String + val jobType = pigeonVar_list[3] as FlutterJobTypeV2 + val message = pigeonVar_list[4] as String + val partnerId = pigeonVar_list[5] as String + val partnerParams = pigeonVar_list[6] as Map? + val status = pigeonVar_list[7] as FlutterSmartSelfieStatus + val updatedAt = pigeonVar_list[8] as String + val userId = pigeonVar_list[9] as String return FlutterSmartSelfieResponse(code, createdAt, jobId, jobType, message, partnerId, partnerParams, status, updatedAt, userId) } } fun toList(): List { - return listOf( + return listOf( code, createdAt, jobId, - jobType.raw, + jobType, message, partnerId, partnerParams, - status.raw, + status, updatedAt, userId, ) @@ -876,37 +1233,36 @@ data class FlutterDocumentVerificationJobResult ( val phoneNumber: String? = null, val phoneNumber2: String? = null, val address: String? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterDocumentVerificationJobResult { - val actions = FlutterActions.fromList(list[0] as List) - val resultCode = list[1] as String - val resultText = list[2] as String - val smileJobId = list[3] as String - val partnerParams = FlutterPartnerParams.fromList(list[4] as List) - val country = list[5] as String? - val idType = list[6] as String? - val idNumber = list[7] as String? - val fullName = list[8] as String? - val dob = list[9] as String? - val gender = list[10] as String? - val expirationDate = list[11] as String? - val documentImageBase64 = list[12] as String? - val phoneNumber = list[13] as String? - val phoneNumber2 = list[14] as String? - val address = list[15] as String? + fun fromList(pigeonVar_list: List): FlutterDocumentVerificationJobResult { + val actions = pigeonVar_list[0] as FlutterActions + val resultCode = pigeonVar_list[1] as String + val resultText = pigeonVar_list[2] as String + val smileJobId = pigeonVar_list[3] as String + val partnerParams = pigeonVar_list[4] as FlutterPartnerParams + val country = pigeonVar_list[5] as String? + val idType = pigeonVar_list[6] as String? + val idNumber = pigeonVar_list[7] as String? + val fullName = pigeonVar_list[8] as String? + val dob = pigeonVar_list[9] as String? + val gender = pigeonVar_list[10] as String? + val expirationDate = pigeonVar_list[11] as String? + val documentImageBase64 = pigeonVar_list[12] as String? + val phoneNumber = pigeonVar_list[13] as String? + val phoneNumber2 = pigeonVar_list[14] as String? + val address = pigeonVar_list[15] as String? return FlutterDocumentVerificationJobResult(actions, resultCode, resultText, smileJobId, partnerParams, country, idType, idNumber, fullName, dob, gender, expirationDate, documentImageBase64, phoneNumber, phoneNumber2, address) } } fun toList(): List { - return listOf( - actions.toList(), + return listOf( + actions, resultCode, resultText, smileJobId, - partnerParams.toList(), + partnerParams, country, idType, idNumber, @@ -932,36 +1288,31 @@ data class FlutterDocumentVerificationJobStatusResponse ( val resultString: String? = null, val history: List? = null, val imageLinks: FlutterImageLinks? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterDocumentVerificationJobStatusResponse { - val timestamp = list[0] as String - val jobComplete = list[1] as Boolean - val jobSuccess = list[2] as Boolean - val code = list[3] as String - val result: FlutterDocumentVerificationJobResult? = (list[4] as List?)?.let { - FlutterDocumentVerificationJobResult.fromList(it) - } - val resultString = list[5] as String? - val history = list[6] as List? - val imageLinks: FlutterImageLinks? = (list[7] as List?)?.let { - FlutterImageLinks.fromList(it) - } + fun fromList(pigeonVar_list: List): FlutterDocumentVerificationJobStatusResponse { + val timestamp = pigeonVar_list[0] as String + val jobComplete = pigeonVar_list[1] as Boolean + val jobSuccess = pigeonVar_list[2] as Boolean + val code = pigeonVar_list[3] as String + val result = pigeonVar_list[4] as FlutterDocumentVerificationJobResult? + val resultString = pigeonVar_list[5] as String? + val history = pigeonVar_list[6] as List? + val imageLinks = pigeonVar_list[7] as FlutterImageLinks? return FlutterDocumentVerificationJobStatusResponse(timestamp, jobComplete, jobSuccess, code, result, resultString, history, imageLinks) } } fun toList(): List { - return listOf( + return listOf( timestamp, jobComplete, jobSuccess, code, - result?.toList(), + result, resultString, history, - imageLinks?.toList(), + imageLinks, ) } } @@ -991,48 +1342,45 @@ data class FlutterBiometricKycJobResult ( val secondaryIdNumber: String? = null, val idNumberPreviouslyRegistered: Boolean? = null, val previousRegistrantsUserIds: List? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterBiometricKycJobResult { - val actions = FlutterActions.fromList(list[0] as List) - val resultCode = list[1] as String - val resultText = list[2] as String - val resultType = list[3] as String - val smileJobId = list[4] as String - val partnerParams = FlutterPartnerParams.fromList(list[5] as List) - val antifraud: FlutterAntifraud? = (list[6] as List?)?.let { - FlutterAntifraud.fromList(it) - } - val dob = list[7] as String? - val photoBase64 = list[8] as String? - val gender = list[9] as String? - val idType = list[10] as String? - val address = list[11] as String? - val country = list[12] as String? - val documentImageBase64 = list[13] as String? - val fullData = list[14] as Map? - val fullName = list[15] as String? - val idNumber = list[16] as String? - val phoneNumber = list[17] as String? - val phoneNumber2 = list[18] as String? - val expirationDate = list[19] as String? - val secondaryIdNumber = list[20] as String? - val idNumberPreviouslyRegistered = list[21] as Boolean? - val previousRegistrantsUserIds = list[22] as List? + fun fromList(pigeonVar_list: List): FlutterBiometricKycJobResult { + val actions = pigeonVar_list[0] as FlutterActions + val resultCode = pigeonVar_list[1] as String + val resultText = pigeonVar_list[2] as String + val resultType = pigeonVar_list[3] as String + val smileJobId = pigeonVar_list[4] as String + val partnerParams = pigeonVar_list[5] as FlutterPartnerParams + val antifraud = pigeonVar_list[6] as FlutterAntifraud? + val dob = pigeonVar_list[7] as String? + val photoBase64 = pigeonVar_list[8] as String? + val gender = pigeonVar_list[9] as String? + val idType = pigeonVar_list[10] as String? + val address = pigeonVar_list[11] as String? + val country = pigeonVar_list[12] as String? + val documentImageBase64 = pigeonVar_list[13] as String? + val fullData = pigeonVar_list[14] as Map? + val fullName = pigeonVar_list[15] as String? + val idNumber = pigeonVar_list[16] as String? + val phoneNumber = pigeonVar_list[17] as String? + val phoneNumber2 = pigeonVar_list[18] as String? + val expirationDate = pigeonVar_list[19] as String? + val secondaryIdNumber = pigeonVar_list[20] as String? + val idNumberPreviouslyRegistered = pigeonVar_list[21] as Boolean? + val previousRegistrantsUserIds = pigeonVar_list[22] as List? return FlutterBiometricKycJobResult(actions, resultCode, resultText, resultType, smileJobId, partnerParams, antifraud, dob, photoBase64, gender, idType, address, country, documentImageBase64, fullData, fullName, idNumber, phoneNumber, phoneNumber2, expirationDate, secondaryIdNumber, idNumberPreviouslyRegistered, previousRegistrantsUserIds) } } fun toList(): List { - return listOf( - actions.toList(), + return listOf( + actions, resultCode, resultText, resultType, smileJobId, - partnerParams.toList(), - antifraud?.toList(), + partnerParams, + antifraud, dob, photoBase64, gender, @@ -1063,36 +1411,31 @@ data class FlutterBiometricKycJobStatusResponse ( val resultString: String? = null, val history: List? = null, val imageLinks: FlutterImageLinks? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterBiometricKycJobStatusResponse { - val timestamp = list[0] as String - val jobComplete = list[1] as Boolean - val jobSuccess = list[2] as Boolean - val code = list[3] as String - val result: FlutterBiometricKycJobResult? = (list[4] as List?)?.let { - FlutterBiometricKycJobResult.fromList(it) - } - val resultString = list[5] as String? - val history = list[6] as List? - val imageLinks: FlutterImageLinks? = (list[7] as List?)?.let { - FlutterImageLinks.fromList(it) - } + fun fromList(pigeonVar_list: List): FlutterBiometricKycJobStatusResponse { + val timestamp = pigeonVar_list[0] as String + val jobComplete = pigeonVar_list[1] as Boolean + val jobSuccess = pigeonVar_list[2] as Boolean + val code = pigeonVar_list[3] as String + val result = pigeonVar_list[4] as FlutterBiometricKycJobResult? + val resultString = pigeonVar_list[5] as String? + val history = pigeonVar_list[6] as List? + val imageLinks = pigeonVar_list[7] as FlutterImageLinks? return FlutterBiometricKycJobStatusResponse(timestamp, jobComplete, jobSuccess, code, result, resultString, history, imageLinks) } } fun toList(): List { - return listOf( + return listOf( timestamp, jobComplete, jobSuccess, code, - result?.toList(), + result, resultString, history, - imageLinks?.toList(), + imageLinks, ) } } @@ -1122,48 +1465,45 @@ data class FlutterEnhancedDocumentVerificationJobResult ( val secondaryIdNumber: String? = null, val idNumberPreviouslyRegistered: Boolean? = null, val previousRegistrantsUserIds: List? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterEnhancedDocumentVerificationJobResult { - val actions = FlutterActions.fromList(list[0] as List) - val resultCode = list[1] as String - val resultText = list[2] as String - val resultType = list[3] as String - val smileJobId = list[4] as String - val partnerParams = FlutterPartnerParams.fromList(list[5] as List) - val antifraud: FlutterAntifraud? = (list[6] as List?)?.let { - FlutterAntifraud.fromList(it) - } - val dob = list[7] as String? - val photoBase64 = list[8] as String? - val gender = list[9] as String? - val idType = list[10] as String? - val address = list[11] as String? - val country = list[12] as String? - val documentImageBase64 = list[13] as String? - val fullData = list[14] as Map? - val fullName = list[15] as String? - val idNumber = list[16] as String? - val phoneNumber = list[17] as String? - val phoneNumber2 = list[18] as String? - val expirationDate = list[19] as String? - val secondaryIdNumber = list[20] as String? - val idNumberPreviouslyRegistered = list[21] as Boolean? - val previousRegistrantsUserIds = list[22] as List? + fun fromList(pigeonVar_list: List): FlutterEnhancedDocumentVerificationJobResult { + val actions = pigeonVar_list[0] as FlutterActions + val resultCode = pigeonVar_list[1] as String + val resultText = pigeonVar_list[2] as String + val resultType = pigeonVar_list[3] as String + val smileJobId = pigeonVar_list[4] as String + val partnerParams = pigeonVar_list[5] as FlutterPartnerParams + val antifraud = pigeonVar_list[6] as FlutterAntifraud? + val dob = pigeonVar_list[7] as String? + val photoBase64 = pigeonVar_list[8] as String? + val gender = pigeonVar_list[9] as String? + val idType = pigeonVar_list[10] as String? + val address = pigeonVar_list[11] as String? + val country = pigeonVar_list[12] as String? + val documentImageBase64 = pigeonVar_list[13] as String? + val fullData = pigeonVar_list[14] as Map? + val fullName = pigeonVar_list[15] as String? + val idNumber = pigeonVar_list[16] as String? + val phoneNumber = pigeonVar_list[17] as String? + val phoneNumber2 = pigeonVar_list[18] as String? + val expirationDate = pigeonVar_list[19] as String? + val secondaryIdNumber = pigeonVar_list[20] as String? + val idNumberPreviouslyRegistered = pigeonVar_list[21] as Boolean? + val previousRegistrantsUserIds = pigeonVar_list[22] as List? return FlutterEnhancedDocumentVerificationJobResult(actions, resultCode, resultText, resultType, smileJobId, partnerParams, antifraud, dob, photoBase64, gender, idType, address, country, documentImageBase64, fullData, fullName, idNumber, phoneNumber, phoneNumber2, expirationDate, secondaryIdNumber, idNumberPreviouslyRegistered, previousRegistrantsUserIds) } } fun toList(): List { - return listOf( - actions.toList(), + return listOf( + actions, resultCode, resultText, resultType, smileJobId, - partnerParams.toList(), - antifraud?.toList(), + partnerParams, + antifraud, dob, photoBase64, gender, @@ -1194,36 +1534,31 @@ data class FlutterEnhancedDocumentVerificationJobStatusResponse ( val resultString: String? = null, val history: List? = null, val imageLinks: FlutterImageLinks? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterEnhancedDocumentVerificationJobStatusResponse { - val timestamp = list[0] as String - val jobComplete = list[1] as Boolean - val jobSuccess = list[2] as Boolean - val code = list[3] as String - val result: FlutterEnhancedDocumentVerificationJobResult? = (list[4] as List?)?.let { - FlutterEnhancedDocumentVerificationJobResult.fromList(it) - } - val resultString = list[5] as String? - val history = list[6] as List? - val imageLinks: FlutterImageLinks? = (list[7] as List?)?.let { - FlutterImageLinks.fromList(it) - } + fun fromList(pigeonVar_list: List): FlutterEnhancedDocumentVerificationJobStatusResponse { + val timestamp = pigeonVar_list[0] as String + val jobComplete = pigeonVar_list[1] as Boolean + val jobSuccess = pigeonVar_list[2] as Boolean + val code = pigeonVar_list[3] as String + val result = pigeonVar_list[4] as FlutterEnhancedDocumentVerificationJobResult? + val resultString = pigeonVar_list[5] as String? + val history = pigeonVar_list[6] as List? + val imageLinks = pigeonVar_list[7] as FlutterImageLinks? return FlutterEnhancedDocumentVerificationJobStatusResponse(timestamp, jobComplete, jobSuccess, code, result, resultString, history, imageLinks) } } fun toList(): List { - return listOf( + return listOf( timestamp, jobComplete, jobSuccess, code, - result?.toList(), + result, resultString, history, - imageLinks?.toList(), + imageLinks, ) } } @@ -1233,19 +1568,18 @@ data class FlutterProductsConfigRequest ( val partnerId: String, val timestamp: String, val signature: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterProductsConfigRequest { - val partnerId = list[0] as String - val timestamp = list[1] as String - val signature = list[2] as String + fun fromList(pigeonVar_list: List): FlutterProductsConfigRequest { + val partnerId = pigeonVar_list[0] as String + val timestamp = pigeonVar_list[1] as String + val signature = pigeonVar_list[2] as String return FlutterProductsConfigRequest(partnerId, timestamp, signature) } } fun toList(): List { - return listOf( + return listOf( partnerId, timestamp, signature, @@ -1257,20 +1591,19 @@ data class FlutterProductsConfigRequest ( data class FlutterProductsConfigResponse ( val consentRequired: Map?>, val idSelection: FlutterIdSelection - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterProductsConfigResponse { - val consentRequired = list[0] as Map?> - val idSelection = FlutterIdSelection.fromList(list[1] as List) + fun fromList(pigeonVar_list: List): FlutterProductsConfigResponse { + val consentRequired = pigeonVar_list[0] as Map?> + val idSelection = pigeonVar_list[1] as FlutterIdSelection return FlutterProductsConfigResponse(consentRequired, idSelection) } } fun toList(): List { - return listOf( + return listOf( consentRequired, - idSelection.toList(), + idSelection, ) } } @@ -1281,20 +1614,19 @@ data class FlutterIdSelection ( val biometricKyc: Map?>, val enhancedKyc: Map?>, val documentVerification: Map?> - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterIdSelection { - val basicKyc = list[0] as Map?> - val biometricKyc = list[1] as Map?> - val enhancedKyc = list[2] as Map?> - val documentVerification = list[3] as Map?> + fun fromList(pigeonVar_list: List): FlutterIdSelection { + val basicKyc = pigeonVar_list[0] as Map?> + val biometricKyc = pigeonVar_list[1] as Map?> + val enhancedKyc = pigeonVar_list[2] as Map?> + val documentVerification = pigeonVar_list[3] as Map?> return FlutterIdSelection(basicKyc, biometricKyc, enhancedKyc, documentVerification) } } fun toList(): List { - return listOf( + return listOf( basicKyc, biometricKyc, enhancedKyc, @@ -1306,17 +1638,16 @@ data class FlutterIdSelection ( /** Generated class from Pigeon that represents data sent in messages. */ data class FlutterValidDocumentsResponse ( val validDocuments: List - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterValidDocumentsResponse { - val validDocuments = list[0] as List + fun fromList(pigeonVar_list: List): FlutterValidDocumentsResponse { + val validDocuments = pigeonVar_list[0] as List return FlutterValidDocumentsResponse(validDocuments) } } fun toList(): List { - return listOf( + return listOf( validDocuments, ) } @@ -1326,19 +1657,18 @@ data class FlutterValidDocumentsResponse ( data class FlutterValidDocument ( val country: FlutterCountry, val idTypes: List - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterValidDocument { - val country = FlutterCountry.fromList(list[0] as List) - val idTypes = list[1] as List + fun fromList(pigeonVar_list: List): FlutterValidDocument { + val country = pigeonVar_list[0] as FlutterCountry + val idTypes = pigeonVar_list[1] as List return FlutterValidDocument(country, idTypes) } } fun toList(): List { - return listOf( - country.toList(), + return listOf( + country, idTypes, ) } @@ -1349,19 +1679,18 @@ data class FlutterCountry ( val code: String, val continent: String, val name: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterCountry { - val code = list[0] as String - val continent = list[1] as String - val name = list[2] as String + fun fromList(pigeonVar_list: List): FlutterCountry { + val code = pigeonVar_list[0] as String + val continent = pigeonVar_list[1] as String + val name = pigeonVar_list[2] as String return FlutterCountry(code, continent, name) } } fun toList(): List { - return listOf( + return listOf( code, continent, name, @@ -1375,20 +1704,19 @@ data class FlutterIdType ( val example: List, val hasBack: Boolean, val name: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterIdType { - val code = list[0] as String - val example = list[1] as List - val hasBack = list[2] as Boolean - val name = list[3] as String + fun fromList(pigeonVar_list: List): FlutterIdType { + val code = pigeonVar_list[0] as String + val example = pigeonVar_list[1] as List + val hasBack = pigeonVar_list[2] as Boolean + val name = pigeonVar_list[3] as String return FlutterIdType(code, example, hasBack, name) } } fun toList(): List { - return listOf( + return listOf( code, example, hasBack, @@ -1401,20 +1729,19 @@ data class FlutterIdType ( data class FlutterServicesResponse ( val bankCodes: List, val hostedWeb: FlutterHostedWeb - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterServicesResponse { - val bankCodes = list[0] as List - val hostedWeb = FlutterHostedWeb.fromList(list[1] as List) + fun fromList(pigeonVar_list: List): FlutterServicesResponse { + val bankCodes = pigeonVar_list[0] as List + val hostedWeb = pigeonVar_list[1] as FlutterHostedWeb return FlutterServicesResponse(bankCodes, hostedWeb) } } fun toList(): List { - return listOf( + return listOf( bankCodes, - hostedWeb.toList(), + hostedWeb, ) } } @@ -1423,18 +1750,17 @@ data class FlutterServicesResponse ( data class FlutterBankCode ( val name: String, val code: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterBankCode { - val name = list[0] as String - val code = list[1] as String + fun fromList(pigeonVar_list: List): FlutterBankCode { + val name = pigeonVar_list[0] as String + val code = pigeonVar_list[1] as String return FlutterBankCode(name, code) } } fun toList(): List { - return listOf( + return listOf( name, code, ) @@ -1449,22 +1775,21 @@ data class FlutterHostedWeb ( val documentVerification: Map, val enhancedKycSmartSelfie: Map, val enhancedDocumentVerification: Map - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterHostedWeb { - val basicKyc = list[0] as Map - val biometricKyc = list[1] as Map - val enhancedKyc = list[2] as Map - val documentVerification = list[3] as Map - val enhancedKycSmartSelfie = list[4] as Map - val enhancedDocumentVerification = list[5] as Map + fun fromList(pigeonVar_list: List): FlutterHostedWeb { + val basicKyc = pigeonVar_list[0] as Map + val biometricKyc = pigeonVar_list[1] as Map + val enhancedKyc = pigeonVar_list[2] as Map + val documentVerification = pigeonVar_list[3] as Map + val enhancedKycSmartSelfie = pigeonVar_list[4] as Map + val enhancedDocumentVerification = pigeonVar_list[5] as Map return FlutterHostedWeb(basicKyc, biometricKyc, enhancedKyc, documentVerification, enhancedKycSmartSelfie, enhancedDocumentVerification) } } fun toList(): List { - return listOf( + return listOf( basicKyc, biometricKyc, enhancedKyc, @@ -1480,19 +1805,18 @@ data class FlutterCountryInfo ( val countryCode: String, val name: String, val availableIdTypes: List - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterCountryInfo { - val countryCode = list[0] as String - val name = list[1] as String - val availableIdTypes = list[2] as List + fun fromList(pigeonVar_list: List): FlutterCountryInfo { + val countryCode = pigeonVar_list[0] as String + val name = pigeonVar_list[1] as String + val availableIdTypes = pigeonVar_list[2] as List return FlutterCountryInfo(countryCode, name, availableIdTypes) } } fun toList(): List { - return listOf( + return listOf( countryCode, name, availableIdTypes, @@ -1507,21 +1831,20 @@ data class FlutterAvailableIdType ( val requiredFields: List, val testData: String? = null, val idNumberRegex: String? = null - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterAvailableIdType { - val idTypeKey = list[0] as String - val label = list[1] as String - val requiredFields = list[2] as List - val testData = list[3] as String? - val idNumberRegex = list[4] as String? + fun fromList(pigeonVar_list: List): FlutterAvailableIdType { + val idTypeKey = pigeonVar_list[0] as String + val label = pigeonVar_list[1] as String + val requiredFields = pigeonVar_list[2] as List + val testData = pigeonVar_list[3] as String? + val idNumberRegex = pigeonVar_list[4] as String? return FlutterAvailableIdType(idTypeKey, label, requiredFields, testData, idNumberRegex) } } fun toList(): List { - return listOf( + return listOf( idTypeKey, label, requiredFields, @@ -1537,20 +1860,19 @@ data class FlutterConfig ( val authToken: String, val prodBaseUrl: String, val sandboxBaseUrl: String - -) { +) + { companion object { - @Suppress("UNCHECKED_CAST") - fun fromList(list: List): FlutterConfig { - val partnerId = list[0] as String - val authToken = list[1] as String - val prodBaseUrl = list[2] as String - val sandboxBaseUrl = list[3] as String + fun fromList(pigeonVar_list: List): FlutterConfig { + val partnerId = pigeonVar_list[0] as String + val authToken = pigeonVar_list[1] as String + val prodBaseUrl = pigeonVar_list[2] as String + val sandboxBaseUrl = pigeonVar_list[3] as String return FlutterConfig(partnerId, authToken, prodBaseUrl, sandboxBaseUrl) } } fun toList(): List { - return listOf( + return listOf( partnerId, authToken, prodBaseUrl, @@ -1558,124 +1880,117 @@ data class FlutterConfig ( ) } } - -@Suppress("UNCHECKED_CAST") -private object SmileIDApiCodec : StandardMessageCodec() { +private open class SmileIDMessagesPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { - 128.toByte() -> { - return (readValue(buffer) as? List)?.let { - FlutterActions.fromList(it) - } - } 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - FlutterAntifraud.fromList(it) + return (readValue(buffer) as Long?)?.let { + FlutterJobType.ofRaw(it.toInt()) } } 130.toByte() -> { - return (readValue(buffer) as? List)?.let { - FlutterAuthenticationRequest.fromList(it) + return (readValue(buffer) as Long?)?.let { + FlutterJobTypeV2.ofRaw(it.toInt()) } } 131.toByte() -> { - return (readValue(buffer) as? List)?.let { - FlutterAuthenticationResponse.fromList(it) + return (readValue(buffer) as Long?)?.let { + FlutterImageType.ofRaw(it.toInt()) } } 132.toByte() -> { - return (readValue(buffer) as? List)?.let { - FlutterAvailableIdType.fromList(it) + return (readValue(buffer) as Long?)?.let { + FlutterActionResult.ofRaw(it.toInt()) } } 133.toByte() -> { - return (readValue(buffer) as? List)?.let { - FlutterBankCode.fromList(it) + return (readValue(buffer) as Long?)?.let { + FlutterSmartSelfieStatus.ofRaw(it.toInt()) } } 134.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterBiometricKycJobResult.fromList(it) + FlutterPartnerParams.fromList(it) } } 135.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterBiometricKycJobResult.fromList(it) + SmartSelfieCreationParams.fromList(it) } } 136.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterBiometricKycJobStatusResponse.fromList(it) + SmartSelfieEnhancedCreationParams.fromList(it) } } 137.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterConfig.fromList(it) + SmartSelfieCaptureResult.fromList(it) } } 138.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterConsentInfo.fromList(it) + DocumentVerificationCreationParams.fromList(it) } } 139.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterCountry.fromList(it) + DocumentVerificationEnhancedCreationParams.fromList(it) } } 140.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterCountryInfo.fromList(it) + DocumentCaptureResult.fromList(it) } } 141.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterDocumentVerificationJobResult.fromList(it) + BiometricKYCCreationParams.fromList(it) } } 142.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterDocumentVerificationJobResult.fromList(it) + BiometricKYCCaptureResult.fromList(it) } } 143.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterDocumentVerificationJobStatusResponse.fromList(it) + SelfieCaptureViewCreationParams.fromList(it) } } 144.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterEnhancedDocumentVerificationJobResult.fromList(it) + DocumentCaptureCreationParams.fromList(it) } } 145.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterEnhancedDocumentVerificationJobResult.fromList(it) + FlutterAuthenticationRequest.fromList(it) } } 146.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterEnhancedDocumentVerificationJobStatusResponse.fromList(it) + FlutterAuthenticationResponse.fromList(it) } } 147.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterEnhancedKycAsyncResponse.fromList(it) + FlutterPrepUploadRequest.fromList(it) } } 148.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterEnhancedKycRequest.fromList(it) + FlutterPrepUploadResponse.fromList(it) } } 149.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterEnhancedKycResponse.fromList(it) + FlutterUploadRequest.fromList(it) } } 150.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterHostedWeb.fromList(it) + FlutterUploadImageInfo.fromList(it) } } 151.toByte() -> { @@ -1685,193 +2000,249 @@ private object SmileIDApiCodec : StandardMessageCodec() { } 152.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterIdSelection.fromList(it) + FlutterEnhancedKycResponse.fromList(it) } } 153.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterIdType.fromList(it) + FlutterActions.fromList(it) } } 154.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterImageLinks.fromList(it) + FlutterConsentInfo.fromList(it) } } 155.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterJobStatusRequest.fromList(it) + FlutterEnhancedKycRequest.fromList(it) } } 156.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterPartnerParams.fromList(it) + FlutterEnhancedKycAsyncResponse.fromList(it) } } 157.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterPrepUploadRequest.fromList(it) + FlutterImageLinks.fromList(it) } } 158.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterPrepUploadResponse.fromList(it) + FlutterAntifraud.fromList(it) } } 159.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterProductsConfigRequest.fromList(it) + FlutterSuspectUser.fromList(it) } } 160.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterProductsConfigResponse.fromList(it) + FlutterJobStatusRequest.fromList(it) } } 161.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterServicesResponse.fromList(it) + FlutterSmartSelfieJobResult.fromList(it) } } 162.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterSmartSelfieJobResult.fromList(it) + FlutterSmartSelfieJobStatusResponse.fromList(it) } } 163.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterSmartSelfieJobResult.fromList(it) + FlutterSmartSelfieResponse.fromList(it) } } 164.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterSmartSelfieJobStatusResponse.fromList(it) + FlutterDocumentVerificationJobResult.fromList(it) } } 165.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterSmartSelfieResponse.fromList(it) + FlutterDocumentVerificationJobStatusResponse.fromList(it) } } 166.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterSuspectUser.fromList(it) + FlutterBiometricKycJobResult.fromList(it) } } 167.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterUploadImageInfo.fromList(it) + FlutterBiometricKycJobStatusResponse.fromList(it) } } 168.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterUploadRequest.fromList(it) + FlutterEnhancedDocumentVerificationJobResult.fromList(it) } } 169.toByte() -> { return (readValue(buffer) as? List)?.let { - FlutterValidDocument.fromList(it) + FlutterEnhancedDocumentVerificationJobStatusResponse.fromList(it) } } 170.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterProductsConfigRequest.fromList(it) + } + } + 171.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterProductsConfigResponse.fromList(it) + } + } + 172.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterIdSelection.fromList(it) + } + } + 173.toByte() -> { return (readValue(buffer) as? List)?.let { FlutterValidDocumentsResponse.fromList(it) } } + 174.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterValidDocument.fromList(it) + } + } + 175.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterCountry.fromList(it) + } + } + 176.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterIdType.fromList(it) + } + } + 177.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterServicesResponse.fromList(it) + } + } + 178.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterBankCode.fromList(it) + } + } + 179.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterHostedWeb.fromList(it) + } + } + 180.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterCountryInfo.fromList(it) + } + } + 181.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterAvailableIdType.fromList(it) + } + } + 182.toByte() -> { + return (readValue(buffer) as? List)?.let { + FlutterConfig.fromList(it) + } + } else -> super.readValueOfType(type, buffer) } } override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { - is FlutterActions -> { - stream.write(128) - writeValue(stream, value.toList()) - } - is FlutterAntifraud -> { + is FlutterJobType -> { stream.write(129) - writeValue(stream, value.toList()) + writeValue(stream, value.raw) } - is FlutterAuthenticationRequest -> { + is FlutterJobTypeV2 -> { stream.write(130) - writeValue(stream, value.toList()) + writeValue(stream, value.raw) } - is FlutterAuthenticationResponse -> { + is FlutterImageType -> { stream.write(131) - writeValue(stream, value.toList()) + writeValue(stream, value.raw) } - is FlutterAvailableIdType -> { + is FlutterActionResult -> { stream.write(132) - writeValue(stream, value.toList()) + writeValue(stream, value.raw) } - is FlutterBankCode -> { + is FlutterSmartSelfieStatus -> { stream.write(133) - writeValue(stream, value.toList()) + writeValue(stream, value.raw) } - is FlutterBiometricKycJobResult -> { + is FlutterPartnerParams -> { stream.write(134) writeValue(stream, value.toList()) } - is FlutterBiometricKycJobResult -> { + is SmartSelfieCreationParams -> { stream.write(135) writeValue(stream, value.toList()) } - is FlutterBiometricKycJobStatusResponse -> { + is SmartSelfieEnhancedCreationParams -> { stream.write(136) writeValue(stream, value.toList()) } - is FlutterConfig -> { + is SmartSelfieCaptureResult -> { stream.write(137) writeValue(stream, value.toList()) } - is FlutterConsentInfo -> { + is DocumentVerificationCreationParams -> { stream.write(138) writeValue(stream, value.toList()) } - is FlutterCountry -> { + is DocumentVerificationEnhancedCreationParams -> { stream.write(139) writeValue(stream, value.toList()) } - is FlutterCountryInfo -> { + is DocumentCaptureResult -> { stream.write(140) writeValue(stream, value.toList()) } - is FlutterDocumentVerificationJobResult -> { + is BiometricKYCCreationParams -> { stream.write(141) writeValue(stream, value.toList()) } - is FlutterDocumentVerificationJobResult -> { + is BiometricKYCCaptureResult -> { stream.write(142) writeValue(stream, value.toList()) } - is FlutterDocumentVerificationJobStatusResponse -> { + is SelfieCaptureViewCreationParams -> { stream.write(143) writeValue(stream, value.toList()) } - is FlutterEnhancedDocumentVerificationJobResult -> { + is DocumentCaptureCreationParams -> { stream.write(144) writeValue(stream, value.toList()) } - is FlutterEnhancedDocumentVerificationJobResult -> { + is FlutterAuthenticationRequest -> { stream.write(145) writeValue(stream, value.toList()) } - is FlutterEnhancedDocumentVerificationJobStatusResponse -> { + is FlutterAuthenticationResponse -> { stream.write(146) writeValue(stream, value.toList()) } - is FlutterEnhancedKycAsyncResponse -> { + is FlutterPrepUploadRequest -> { stream.write(147) writeValue(stream, value.toList()) } - is FlutterEnhancedKycRequest -> { + is FlutterPrepUploadResponse -> { stream.write(148) writeValue(stream, value.toList()) } - is FlutterEnhancedKycResponse -> { + is FlutterUploadRequest -> { stream.write(149) writeValue(stream, value.toList()) } - is FlutterHostedWeb -> { + is FlutterUploadImageInfo -> { stream.write(150) writeValue(stream, value.toList()) } @@ -1879,87 +2250,340 @@ private object SmileIDApiCodec : StandardMessageCodec() { stream.write(151) writeValue(stream, value.toList()) } - is FlutterIdSelection -> { + is FlutterEnhancedKycResponse -> { stream.write(152) writeValue(stream, value.toList()) } - is FlutterIdType -> { + is FlutterActions -> { stream.write(153) writeValue(stream, value.toList()) } - is FlutterImageLinks -> { + is FlutterConsentInfo -> { stream.write(154) writeValue(stream, value.toList()) } - is FlutterJobStatusRequest -> { + is FlutterEnhancedKycRequest -> { stream.write(155) writeValue(stream, value.toList()) } - is FlutterPartnerParams -> { + is FlutterEnhancedKycAsyncResponse -> { stream.write(156) writeValue(stream, value.toList()) } - is FlutterPrepUploadRequest -> { + is FlutterImageLinks -> { stream.write(157) writeValue(stream, value.toList()) } - is FlutterPrepUploadResponse -> { + is FlutterAntifraud -> { stream.write(158) writeValue(stream, value.toList()) } - is FlutterProductsConfigRequest -> { + is FlutterSuspectUser -> { stream.write(159) writeValue(stream, value.toList()) } - is FlutterProductsConfigResponse -> { + is FlutterJobStatusRequest -> { stream.write(160) writeValue(stream, value.toList()) } - is FlutterServicesResponse -> { + is FlutterSmartSelfieJobResult -> { stream.write(161) writeValue(stream, value.toList()) } - is FlutterSmartSelfieJobResult -> { + is FlutterSmartSelfieJobStatusResponse -> { stream.write(162) writeValue(stream, value.toList()) } - is FlutterSmartSelfieJobResult -> { + is FlutterSmartSelfieResponse -> { stream.write(163) writeValue(stream, value.toList()) } - is FlutterSmartSelfieJobStatusResponse -> { + is FlutterDocumentVerificationJobResult -> { stream.write(164) writeValue(stream, value.toList()) } - is FlutterSmartSelfieResponse -> { + is FlutterDocumentVerificationJobStatusResponse -> { stream.write(165) writeValue(stream, value.toList()) } - is FlutterSuspectUser -> { + is FlutterBiometricKycJobResult -> { stream.write(166) writeValue(stream, value.toList()) } - is FlutterUploadImageInfo -> { + is FlutterBiometricKycJobStatusResponse -> { stream.write(167) writeValue(stream, value.toList()) } - is FlutterUploadRequest -> { + is FlutterEnhancedDocumentVerificationJobResult -> { stream.write(168) writeValue(stream, value.toList()) } - is FlutterValidDocument -> { + is FlutterEnhancedDocumentVerificationJobStatusResponse -> { stream.write(169) writeValue(stream, value.toList()) } - is FlutterValidDocumentsResponse -> { + is FlutterProductsConfigRequest -> { stream.write(170) writeValue(stream, value.toList()) } + is FlutterProductsConfigResponse -> { + stream.write(171) + writeValue(stream, value.toList()) + } + is FlutterIdSelection -> { + stream.write(172) + writeValue(stream, value.toList()) + } + is FlutterValidDocumentsResponse -> { + stream.write(173) + writeValue(stream, value.toList()) + } + is FlutterValidDocument -> { + stream.write(174) + writeValue(stream, value.toList()) + } + is FlutterCountry -> { + stream.write(175) + writeValue(stream, value.toList()) + } + is FlutterIdType -> { + stream.write(176) + writeValue(stream, value.toList()) + } + is FlutterServicesResponse -> { + stream.write(177) + writeValue(stream, value.toList()) + } + is FlutterBankCode -> { + stream.write(178) + writeValue(stream, value.toList()) + } + is FlutterHostedWeb -> { + stream.write(179) + writeValue(stream, value.toList()) + } + is FlutterCountryInfo -> { + stream.write(180) + writeValue(stream, value.toList()) + } + is FlutterAvailableIdType -> { + stream.write(181) + writeValue(stream, value.toList()) + } + is FlutterConfig -> { + stream.write(182) + writeValue(stream, value.toList()) + } else -> super.writeValue(stream, value) } } } + +/** Generated interface from Pigeon that represents a handler of messages from Flutter. */ +interface SmileIDProductsApi { + fun documentVerification(creationParams: DocumentVerificationCreationParams, callback: (Result) -> Unit) + fun documentVerificationEnhanced(creationParams: DocumentVerificationEnhancedCreationParams, callback: (Result) -> Unit) + fun smartSelfieEnrollment(creationParams: SmartSelfieCreationParams, callback: (Result) -> Unit) + fun smartSelfieAuthentication(creationParams: SmartSelfieCreationParams, callback: (Result) -> Unit) + fun smartSelfieEnrollmentEnhanced(creationParams: SmartSelfieEnhancedCreationParams, callback: (Result) -> Unit) + fun smartSelfieAuthenticationEnhanced(creationParams: SmartSelfieEnhancedCreationParams, callback: (Result) -> Unit) + fun biometricKYC(creationParams: BiometricKYCCreationParams, callback: (Result) -> Unit) + fun selfieCapture(creationParams: SelfieCaptureViewCreationParams, callback: (Result) -> Unit) + fun documentCapture(creationParams: DocumentCaptureCreationParams, callback: (Result) -> Unit) + + companion object { + /** The codec used by SmileIDProductsApi. */ + val codec: MessageCodec by lazy { + SmileIDMessagesPigeonCodec() + } + /** Sets up an instance of `SmileIDProductsApi` to handle messages through the `binaryMessenger`. */ + @JvmOverloads + fun setUp(binaryMessenger: BinaryMessenger, api: SmileIDProductsApi?, messageChannelSuffix: String = "") { + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDProductsApi.documentVerification$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val creationParamsArg = args[0] as DocumentVerificationCreationParams + api.documentVerification(creationParamsArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDProductsApi.documentVerificationEnhanced$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val creationParamsArg = args[0] as DocumentVerificationEnhancedCreationParams + api.documentVerificationEnhanced(creationParamsArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieEnrollment$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val creationParamsArg = args[0] as SmartSelfieCreationParams + api.smartSelfieEnrollment(creationParamsArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieAuthentication$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val creationParamsArg = args[0] as SmartSelfieCreationParams + api.smartSelfieAuthentication(creationParamsArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieEnrollmentEnhanced$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val creationParamsArg = args[0] as SmartSelfieEnhancedCreationParams + api.smartSelfieEnrollmentEnhanced(creationParamsArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieAuthenticationEnhanced$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val creationParamsArg = args[0] as SmartSelfieEnhancedCreationParams + api.smartSelfieAuthenticationEnhanced(creationParamsArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDProductsApi.biometricKYC$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val creationParamsArg = args[0] as BiometricKYCCreationParams + api.biometricKYC(creationParamsArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDProductsApi.selfieCapture$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val creationParamsArg = args[0] as SelfieCaptureViewCreationParams + api.selfieCapture(creationParamsArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDProductsApi.documentCapture$separatedMessageChannelSuffix", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val creationParamsArg = args[0] as DocumentCaptureCreationParams + api.documentCapture(creationParamsArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + } + } +} /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface SmileIDApi { fun initializeWithApiKey(apiKey: String, config: FlutterConfig, useSandbox: Boolean, enableCrashReporting: Boolean) @@ -1994,13 +2618,14 @@ interface SmileIDApi { companion object { /** The codec used by SmileIDApi. */ val codec: MessageCodec by lazy { - SmileIDApiCodec + SmileIDMessagesPigeonCodec() } /** Sets up an instance of `SmileIDApi` to handle messages through the `binaryMessenger`. */ - @Suppress("UNCHECKED_CAST") - fun setUp(binaryMessenger: BinaryMessenger, api: SmileIDApi?) { + @JvmOverloads + fun setUp(binaryMessenger: BinaryMessenger, api: SmileIDApi?, messageChannelSuffix: String = "") { + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.initializeWithApiKey", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.initializeWithApiKey$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2008,12 +2633,11 @@ interface SmileIDApi { val configArg = args[1] as FlutterConfig val useSandboxArg = args[2] as Boolean val enableCrashReportingArg = args[3] as Boolean - var wrapped: List - try { + val wrapped: List = try { api.initializeWithApiKey(apiKeyArg, configArg, useSandboxArg, enableCrashReportingArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2022,19 +2646,18 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.initializeWithConfig", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.initializeWithConfig$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val configArg = args[0] as FlutterConfig val useSandboxArg = args[1] as Boolean val enableCrashReportingArg = args[2] as Boolean - var wrapped: List - try { + val wrapped: List = try { api.initializeWithConfig(configArg, useSandboxArg, enableCrashReportingArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2043,17 +2666,16 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.initialize", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.initialize$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val useSandboxArg = args[0] as Boolean - var wrapped: List - try { + val wrapped: List = try { api.initialize(useSandboxArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2062,17 +2684,16 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.setCallbackUrl", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.setCallbackUrl$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val callbackUrlArg = args[0] as String - var wrapped: List - try { + val wrapped: List = try { api.setCallbackUrl(callbackUrlArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2081,17 +2702,16 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.setAllowOfflineMode", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.setAllowOfflineMode$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val allowOfflineModeArg = args[0] as Boolean - var wrapped: List - try { + val wrapped: List = try { api.setAllowOfflineMode(allowOfflineModeArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2100,14 +2720,13 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getSubmittedJobs", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getSubmittedJobs$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - var wrapped: List - try { - wrapped = listOf(api.getSubmittedJobs()) + val wrapped: List = try { + listOf(api.getSubmittedJobs()) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2116,14 +2735,13 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getUnsubmittedJobs", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getUnsubmittedJobs$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - var wrapped: List - try { - wrapped = listOf(api.getUnsubmittedJobs()) + val wrapped: List = try { + listOf(api.getUnsubmittedJobs()) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2132,17 +2750,16 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.cleanup", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.cleanup$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val jobIdArg = args[0] as String - var wrapped: List - try { + val wrapped: List = try { api.cleanup(jobIdArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2151,17 +2768,16 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.cleanupJobs", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.cleanupJobs$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val jobIdsArg = args[0] as List - var wrapped: List - try { + val wrapped: List = try { api.cleanupJobs(jobIdsArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2170,18 +2786,17 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.submitJob", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.submitJob$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val jobIdArg = args[0] as String val deleteFilesOnSuccessArg = args[1] as Boolean - var wrapped: List - try { + val wrapped: List = try { api.submitJob(jobIdArg, deleteFilesOnSuccessArg) - wrapped = listOf(null) + listOf(null) } catch (exception: Throwable) { - wrapped = wrapError(exception) + wrapError(exception) } reply.reply(wrapped) } @@ -2190,7 +2805,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.authenticate", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.authenticate$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2210,7 +2825,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.prepUpload", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.prepUpload$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2230,7 +2845,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.upload", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.upload$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2250,7 +2865,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKyc", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKyc$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2270,7 +2885,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKycAsync", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKycAsync$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2290,7 +2905,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getSmartSelfieJobStatus", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getSmartSelfieJobStatus$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2310,7 +2925,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieEnrollment", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieEnrollment$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2321,7 +2936,7 @@ interface SmileIDApi { val userIdArg = args[4] as String val partnerParamsArg = args[5] as Map? val callbackUrlArg = args[6] as String? - val sandboxResultArg = args[7].let { if (it is Int) it.toLong() else it as Long? } + val sandboxResultArg = args[7] as Long? val allowNewEnrollArg = args[8] as Boolean? api.doSmartSelfieEnrollment(signatureArg, timestampArg, selfieImageArg, livenessImagesArg, userIdArg, partnerParamsArg, callbackUrlArg, sandboxResultArg, allowNewEnrollArg) { result: Result -> val error = result.exceptionOrNull() @@ -2338,7 +2953,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieAuthentication", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieAuthentication$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2349,7 +2964,7 @@ interface SmileIDApi { val userIdArg = args[4] as String val partnerParamsArg = args[5] as Map? val callbackUrlArg = args[6] as String? - val sandboxResultArg = args[7].let { if (it is Int) it.toLong() else it as Long? } + val sandboxResultArg = args[7] as Long? api.doSmartSelfieAuthentication(signatureArg, timestampArg, selfieImageArg, livenessImagesArg, userIdArg, partnerParamsArg, callbackUrlArg, sandboxResultArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2365,7 +2980,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getDocumentVerificationJobStatus", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getDocumentVerificationJobStatus$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2385,7 +3000,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getBiometricKycJobStatus", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getBiometricKycJobStatus$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2405,7 +3020,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getEnhancedDocumentVerificationJobStatus", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getEnhancedDocumentVerificationJobStatus$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2425,7 +3040,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getProductsConfig", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getProductsConfig$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2445,7 +3060,7 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getValidDocuments", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getValidDocuments$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2465,10 +3080,10 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getServices", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.getServices$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.getServices() { result: Result -> + api.getServices{ result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2483,13 +3098,13 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.pollSmartSelfieJobStatus", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.pollSmartSelfieJobStatus$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val requestArg = args[0] as FlutterJobStatusRequest - val intervalArg = args[1].let { if (it is Int) it.toLong() else it as Long } - val numAttemptsArg = args[2].let { if (it is Int) it.toLong() else it as Long } + val intervalArg = args[1] as Long + val numAttemptsArg = args[2] as Long api.pollSmartSelfieJobStatus(requestArg, intervalArg, numAttemptsArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2505,13 +3120,13 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.pollDocumentVerificationJobStatus", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.pollDocumentVerificationJobStatus$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val requestArg = args[0] as FlutterJobStatusRequest - val intervalArg = args[1].let { if (it is Int) it.toLong() else it as Long } - val numAttemptsArg = args[2].let { if (it is Int) it.toLong() else it as Long } + val intervalArg = args[1] as Long + val numAttemptsArg = args[2] as Long api.pollDocumentVerificationJobStatus(requestArg, intervalArg, numAttemptsArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2527,13 +3142,13 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.pollBiometricKycJobStatus", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.pollBiometricKycJobStatus$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val requestArg = args[0] as FlutterJobStatusRequest - val intervalArg = args[1].let { if (it is Int) it.toLong() else it as Long } - val numAttemptsArg = args[2].let { if (it is Int) it.toLong() else it as Long } + val intervalArg = args[1] as Long + val numAttemptsArg = args[2] as Long api.pollBiometricKycJobStatus(requestArg, intervalArg, numAttemptsArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2549,13 +3164,13 @@ interface SmileIDApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.pollEnhancedDocumentVerificationJobStatus", codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.smileid.SmileIDApi.pollEnhancedDocumentVerificationJobStatus$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val requestArg = args[0] as FlutterJobStatusRequest - val intervalArg = args[1].let { if (it is Int) it.toLong() else it as Long } - val numAttemptsArg = args[2].let { if (it is Int) it.toLong() else it as Long } + val intervalArg = args[1] as Long + val numAttemptsArg = args[2] as Long api.pollEnhancedDocumentVerificationJobStatus(requestArg, intervalArg, numAttemptsArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 9625e105..7c569640 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 922cfa0e..09b3da42 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -218,7 +218,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { @@ -474,7 +474,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 99P7YGX9Q6; + DEVELOPMENT_TEAM = 5SB38K2R24; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -655,7 +655,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 99P7YGX9Q6; + DEVELOPMENT_TEAM = 5SB38K2R24; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -679,7 +679,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 99P7YGX9Q6; + DEVELOPMENT_TEAM = 5SB38K2R24; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 87131a09..8e3ca5df 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ ( - builder: (BuildContext context) => MyScaffold( - body: SmileIDDocumentVerification( + onPressed: () async { + final result = await SmileID().documentVerification( + creationParams: DocumentVerificationCreationParams( countryCode: "GH", documentType: "DRIVERS_LICENSE", - onSuccess: (String? result) { - // Your success handling logic - Map jsonResult = json.decode(result ?? '{}'); - String formattedResult = jsonEncode(jsonResult); - final snackBar = SnackBar(content: Text("Success: $formattedResult")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - onError: (String errorMessage) { - // Your error handling logic - final snackBar = SnackBar(content: Text("Error: $errorMessage")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - )), - ), + captureBothSides: true, + allowNewEnroll: false, + showAttribution: true, + allowGalleryUpload: false, + allowAgentMode: false, + showInstructions: true, + skipApiSubmission: false), ); + + switch (result) { + case SmileIDSdkResultSuccess(:final data): + print('verification selfie: ${data.selfieFile}'); + print('verification liveness: ${data.livenessFiles}'); + print('verification backFile: ${data.documentBackFile}'); + print('verification frontFile: ${data.documentFrontFile}'); + print( + 'verification didSubmitVerificationJob: ${data.didSubmitDocumentVerificationJob}'); + case SmileIDSdkResultError(:final error): + print('error occurred with document verification: $error'); + } }, ); } @@ -168,30 +159,30 @@ class MainContent extends StatelessWidget { Widget enhancedDocumentVerificationButton(BuildContext context) { return ElevatedButton( child: const Text("Enhanced Document Verification"), - onPressed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyScaffold( - body: SmileIDEnhancedDocumentVerification( + onPressed: () async { + final result = await SmileID().documentVerificationEnhanced( + creationParams: DocumentVerificationEnhancedCreationParams( countryCode: "GH", documentType: "DRIVERS_LICENSE", - onSuccess: (String? result) { - // Your success handling logic - Map jsonResult = json.decode(result ?? '{}'); - String formattedResult = jsonEncode(jsonResult); - final snackBar = SnackBar(content: Text("Success: $formattedResult")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - onError: (String errorMessage) { - // Your error handling logic - final snackBar = SnackBar(content: Text("Error: $errorMessage")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - )), - ), + captureBothSides: true, + allowNewEnroll: false, + showAttribution: true, + allowAgentMode: false, + allowGalleryUpload: false, + showInstructions: true, + skipApiSubmission: false), ); + + switch (result) { + case SmileIDSdkResultSuccess(:final data): + print('verification selfie: ${data.selfieFile}'); + print('verification liveness: ${data.livenessFiles}'); + print('verification backFile: ${data.documentBackFile}'); + print('verification frontFile: ${data.documentFrontFile}'); + print('verification didSubmitEnhancedDocVJob: ${data.didSubmitEnhancedDocVJob}'); + case SmileIDSdkResultError(:final error): + print('error occurred with document verification enhanced: $error'); + } }, ); } @@ -199,28 +190,24 @@ class MainContent extends StatelessWidget { Widget smartSelfieEnrollmentButton(BuildContext context) { return ElevatedButton( child: const Text("SmartSelfie Enrollment"), - onPressed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyScaffold( - body: SmileIDSmartSelfieEnrollment( - onSuccess: (String? result) { - // Your success handling logic - Map jsonResult = json.decode(result ?? '{}'); - String formattedResult = jsonEncode(jsonResult); - final snackBar = SnackBar(content: Text("Success: $formattedResult")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - onError: (String errorMessage) { - // Your error handling logic - final snackBar = SnackBar(content: Text("Error: $errorMessage")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - )), - ), + onPressed: () async { + final result = await SmileID().smartSelfieEnrollment( + creationParams: SmartSelfieCreationParams( + allowNewEnroll: false, + allowAgentMode: false, + showAttribution: true, + showInstructions: true, + skipApiSubmission: false), ); + + switch (result) { + case SmileIDSdkResultSuccess(:final data): + print('enrollment selfie: ${data.selfieFile}'); + print('enrollment liveness: ${data.livenessFiles}'); + print('enrollment apiResponse: ${data.apiResponse}'); + case SmileIDSdkResultError(:final error): + print('error occurred with smart selfie enrollment: $error'); + } }, ); } @@ -228,28 +215,24 @@ class MainContent extends StatelessWidget { Widget smartSelfieAuthenticationButton(BuildContext context) { return ElevatedButton( child: const Text("SmartSelfie Authentication"), - onPressed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyScaffold( - body: SmileIDSmartSelfieAuthentication( - onSuccess: (String? result) { - // Your success handling logic - Map jsonResult = json.decode(result ?? '{}'); - String formattedResult = jsonEncode(jsonResult); - final snackBar = SnackBar(content: Text("Success: $formattedResult")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - onError: (String errorMessage) { - // Your error handling logic - final snackBar = SnackBar(content: Text("Error: $errorMessage")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - )), - ), + onPressed: () async { + final result = await SmileID().smartSelfieAuthentication( + creationParams: SmartSelfieCreationParams( + allowNewEnroll: false, + allowAgentMode: false, + showAttribution: true, + showInstructions: true, + skipApiSubmission: true), ); + + switch (result) { + case SmileIDSdkResultSuccess(:final data): + print('enrollment selfie: ${data.selfieFile}'); + print('enrollment liveness: ${data.livenessFiles}'); + print('enrollment apiResponse: ${data.apiResponse}'); + case SmileIDSdkResultError(:final error): + print('error occurred with smart selfie authentication: $error'); + } }, ); } @@ -257,28 +240,22 @@ class MainContent extends StatelessWidget { Widget smartSelfieEnrollmentButtonEnhanced(BuildContext context) { return ElevatedButton( child: const Text("SmartSelfie Enrollment (Enhanced)"), - onPressed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyScaffold( - body: SmileIDSmartSelfieEnrollmentEnhanced( - onSuccess: (String? result) { - // Your success handling logic - Map jsonResult = json.decode(result ?? '{}'); - String formattedResult = jsonEncode(jsonResult); - final snackBar = SnackBar(content: Text("Success: $formattedResult")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - onError: (String errorMessage) { - // Your error handling logic - final snackBar = SnackBar(content: Text("Error: $errorMessage")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - )), - ), - ); + onPressed: () async { + final result = await SmileID().smartSelfieEnrollmentEnhanced( + creationParams: SmartSelfieEnhancedCreationParams( + allowNewEnroll: false, + showAttribution: true, + showInstructions: true, + )); + + switch (result) { + case SmileIDSdkResultSuccess(:final data): + print('enrollment selfie: ${data.selfieFile}'); + print('enrollment liveness: ${data.livenessFiles}'); + print('enrollment apiResponse: ${data.apiResponse}'); + case SmileIDSdkResultError(:final error): + print('error occurred with smart selfie enrollment enhanced: $error'); + } }, ); } @@ -286,28 +263,22 @@ class MainContent extends StatelessWidget { Widget smartSelfieAuthenticationButtonEnhanced(BuildContext context) { return ElevatedButton( child: const Text("SmartSelfie Authentication (Enhanced)"), - onPressed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyScaffold( - body: SmileIDSmartSelfieAuthenticationEnhanced( - onSuccess: (String? result) { - // Your success handling logic - Map jsonResult = json.decode(result ?? '{}'); - String formattedResult = jsonEncode(jsonResult); - final snackBar = SnackBar(content: Text("Success: $formattedResult")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - onError: (String errorMessage) { - // Your error handling logic - final snackBar = SnackBar(content: Text("Error: $errorMessage")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - )), - ), - ); + onPressed: () async { + final result = await SmileID().smartSelfieAuthenticationEnhanced( + creationParams: SmartSelfieEnhancedCreationParams( + allowNewEnroll: false, + showAttribution: true, + showInstructions: true, + )); + + switch (result) { + case SmileIDSdkResultSuccess(:final data): + print('enrollment selfie: ${data.selfieFile}'); + print('enrollment liveness: ${data.livenessFiles}'); + print('enrollment apiResponse: ${data.apiResponse}'); + case SmileIDSdkResultError(:final error): + print('error occurred with smart selfie authentication enhanced: $error'); + } }, ); } @@ -315,31 +286,23 @@ class MainContent extends StatelessWidget { Widget biometricKycButton(BuildContext context) { return ElevatedButton( child: const Text("Biometric KYC"), - onPressed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyScaffold( - body: SmileIDBiometricKYC( - country: "KE", - idType: "NATIONAL_ID", - idNumber: "12345678", - onSuccess: (String? result) { - // Your success handling logic - Map jsonResult = json.decode(result ?? '{}'); - String formattedResult = jsonEncode(jsonResult); - final snackBar = SnackBar(content: Text("Success: $formattedResult")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - onError: (String errorMessage) { - // Your error handling logic - final snackBar = SnackBar(content: Text("Error: $errorMessage")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - )), - ), + onPressed: () async { + final result = await SmileID().biometricKYC( + creationParams: BiometricKYCCreationParams( + allowNewEnroll: false, + allowAgentMode: false, + showAttribution: true, + showInstructions: true), ); + + switch (result) { + case SmileIDSdkResultSuccess(:final data): + print('biometric kyc selfie: ${data.selfieFile}'); + print('biometric kyc liveness: ${data.livenessFiles}'); + print('biometric kyc didSubmitKycJob: ${data.didSubmitBiometricKycJob}'); + case SmileIDSdkResultError(:final error): + print('error occurred with biometric kyc: $error'); + } }, ); } @@ -347,32 +310,23 @@ class MainContent extends StatelessWidget { Widget selfieCaptureButton(BuildContext context) { return ElevatedButton( child: const Text("Selfie Capture"), - onPressed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyScaffold( - body: SmileIDSmartSelfieCaptureView( + onPressed: () async { + final result = await SmileID().selfieCapture( + creationParams: SelfieCaptureViewCreationParams( showConfirmationDialog: false, showInstructions: true, showAttribution: false, - allowAgentMode: false, - onSuccess: (String? result) { - // Your success handling logic - Map jsonResult = json.decode(result ?? '{}'); - String formattedResult = jsonEncode(jsonResult); - final snackBar = SnackBar(content: Text("Success: $formattedResult")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - onError: (String errorMessage) { - // Your error handling logic - final snackBar = SnackBar(content: Text("Error: $errorMessage")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - )), - ), + allowAgentMode: false), ); + + switch (result) { + case SmileIDSdkResultSuccess(:final data): + print('capture selfie: ${data.selfieFile}'); + print('capture liveness: ${data.livenessFiles}'); + print('capture apiResponse: ${data.apiResponse}'); + case SmileIDSdkResultError(:final error): + print('error occurred with selfie capture: $error'); + } }, ); } @@ -380,33 +334,23 @@ class MainContent extends StatelessWidget { Widget documentCaptureButton(BuildContext context) { return ElevatedButton( child: const Text("Document Capture"), - onPressed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyScaffold( - body: SmileIDDocumentCaptureView( + onPressed: () async { + final result = await SmileID().documentCapture( + creationParams: DocumentCaptureCreationParams( isDocumentFrontSide: false, - showConfirmationDialog: true, showInstructions: true, showAttribution: false, allowGalleryUpload: false, - onSuccess: (String? result) { - // Your success handling logic - Map jsonResult = json.decode(result ?? '{}'); - String formattedResult = jsonEncode(jsonResult); - final snackBar = SnackBar(content: Text("Success: $formattedResult")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - onError: (String errorMessage) { - // Your error handling logic - final snackBar = SnackBar(content: Text("Error: $errorMessage")); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - Navigator.of(context).pop(); - }, - )), - ), + showConfirmationDialog: true), ); + + switch (result) { + case SmileIDSdkResultSuccess(:final data): + print('document capture front file: ${data.documentFrontFile}'); + print('document capture back file: ${data.documentBackFile}'); + case SmileIDSdkResultError(:final error): + print("error occurred with document capture: $error"); + } }, ); } diff --git a/ios/Classes/Mapper.swift b/ios/Classes/Mapper.swift index 188ccff1..0ce45e1f 100644 --- a/ios/Classes/Mapper.swift +++ b/ios/Classes/Mapper.swift @@ -702,3 +702,19 @@ extension FlutterConfig { ) } } + +extension SmartSelfieResponse { + func buildResponse() -> Dictionary { + return [ + "created_at": self.createdAt, + "job_id": self.jobId, + "job_type": self.jobType.rawValue, + "message": self.message, + "partner_id": self.partnerId, + "partner_params": self.partnerParams, + "status": self.status.rawValue, + "updated_at": self.updatedAt, + "user_id": self.userId, + ]; + } +} diff --git a/ios/Classes/SmileDocumentCaptureView.swift b/ios/Classes/SmileDocumentCaptureView.swift new file mode 100644 index 00000000..9f1af93d --- /dev/null +++ b/ios/Classes/SmileDocumentCaptureView.swift @@ -0,0 +1,77 @@ +import SwiftUI +import SmileID + +struct SmileDocumentCaptureView: View , SmileIDFileUtilsProtocol { + var fileManager: FileManager = Foundation.FileManager.default + private let jobId = generateJobId() + + @State private var localMetadata = LocalMetadata() + + let creationParams: DocumentCaptureCreationParams + let completion: ((Result) -> Void)? + weak var uiViewController: UINavigationController? + + var body: some View { + VStack(alignment: .leading) { + Button("Back") { + completion?(.failure(PigeonError(code: "20", message: "User cancelled operation", details: nil))) + uiViewController?.popViewController(animated: true) + }.padding(.leading, 20) + + NavigationView { + DocumentCaptureScreen( + side: creationParams.isDocumentFrontSide ? .front: .back, + showInstructions: creationParams.showInstructions, + showAttribution: creationParams.showAttribution, + allowGallerySelection: creationParams.allowGalleryUpload, + showSkipButton: false, + instructionsHeroImage: creationParams.isDocumentFrontSide ? SmileIDResourcesHelper.DocVFrontHero: SmileIDResourcesHelper.DocVBackHero, + instructionsTitleText: SmileIDResourcesHelper.localizedString( + for: creationParams.isDocumentFrontSide ? "Instructions.Document.Front.Header": "Instructions.Document.Back.Header" + ), + instructionsSubtitleText: SmileIDResourcesHelper.localizedString( + for: creationParams.isDocumentFrontSide ? "Instructions.Document.Front.Callout": "Instructions.Document.Back.Callout" + ), + captureTitleText: SmileIDResourcesHelper.localizedString(for: "Action.TakePhoto"), + knownIdAspectRatio: creationParams.idAspectRatio, + showConfirmation: creationParams.showConfirmationDialog, + onConfirm: onConfirmed, + onError: didError, + onSkip: onSkip + ).preferredColorScheme(.light) + }.environmentObject(localMetadata).padding() + } + } + + func onConfirmed(data: Data) { + do { + // Attempt to create the document file + let url = try LocalStorage.createDocumentFile( + jobId:jobId, + fileType: creationParams.isDocumentFrontSide ? FileType.documentFront : FileType.documentBack, + document: data + ) + + let result = DocumentCaptureResult( + documentFrontFile: creationParams.isDocumentFrontSide ? url.absoluteString : nil, + documentBackFile: creationParams.isDocumentFrontSide ? nil : url.absoluteString + ) + + completion?(.success(result)) + uiViewController?.popViewController(animated: true) + + } catch { + didError(error: error) + } + } + + func onSkip() { + completion?(.failure(PigeonError(code: "20", message: "User skipped document capture", details: nil))) + uiViewController?.popViewController(animated: true) + } + + func didError(error: Error) { + completion?(.failure(PigeonError(code: "20", message: error.localizedDescription, details: nil))) + uiViewController?.popViewController(animated: true) + } +} diff --git a/ios/Classes/SmileIDBiometricKYCView.swift b/ios/Classes/SmileIDBiometricKYCView.swift new file mode 100644 index 00000000..70985956 --- /dev/null +++ b/ios/Classes/SmileIDBiometricKYCView.swift @@ -0,0 +1,62 @@ +import SwiftUI +import SmileID + +struct SmileIDBiometricKYCView: View, BiometricKycResultDelegate, SmileIDFileUtilsProtocol { + var fileManager: FileManager = Foundation.FileManager.default + + let creationParams: BiometricKYCCreationParams + var completion: ((Result) -> Void)? + + weak var uiViewController: UINavigationController? + + var body: some View { + VStack(alignment: .leading) { + Button("Back") { + completion?(.failure(PigeonError(code: "16", message: "User cancelled operation", details: nil))) + uiViewController?.popViewController(animated: true) + }.padding(.leading, 20) + + SmileID.biometricKycScreen( + idInfo: IdInfo( + country: creationParams.country ?? "", + idType: creationParams.idType, + idNumber: creationParams.idNumber, + firstName: creationParams.firstName, + middleName: creationParams.middleName, + lastName: creationParams.lastName, + dob: creationParams.dob, + bankCode: creationParams.bankCode, + entered: creationParams.entered + ), + userId: creationParams.userId ?? generateUserId(), + jobId: creationParams.jobId ?? generateJobId(), + allowNewEnroll: creationParams.allowNewEnroll, + allowAgentMode: creationParams.allowAgentMode, + showAttribution: creationParams.showAttribution, + showInstructions: creationParams.showInstructions, + extraPartnerParams: creationParams.extraPartnerParams ?? [:], + delegate: self + ).preferredColorScheme(.light) + } + } + + + func didSucceed(selfieImage: URL, livenessImages: [URL], didSubmitBiometricJob: Bool) { + let result = BiometricKYCCaptureResult( + selfieFile: getFilePath(fileName: selfieImage.absoluteString), + livenessFiles: livenessImages.map { + getFilePath(fileName: $0.absoluteString) + }, + didSubmitBiometricKycJob: didSubmitBiometricJob + ) + + completion?(.success(result)) + uiViewController?.popViewController(animated: true) + } + + func didError(error: any Error) { + completion?(.failure(PigeonError(code: "16", message: error.localizedDescription, details: nil))) + uiViewController?.popViewController(animated: true) + } +} + diff --git a/ios/Classes/SmileIDDocumentVerificationView.swift b/ios/Classes/SmileIDDocumentVerificationView.swift new file mode 100644 index 00000000..8dcd1321 --- /dev/null +++ b/ios/Classes/SmileIDDocumentVerificationView.swift @@ -0,0 +1,54 @@ +import SwiftUI +import SmileID + +struct SmileIDDocumentVerificationView: View, DocumentVerificationResultDelegate, SmileIDFileUtilsProtocol { + var fileManager: FileManager = Foundation.FileManager.default + + let creationParams: DocumentVerificationCreationParams + var completion: ((Result) -> Void)? + weak var uiViewController: UINavigationController? + + var body: some View { + VStack(alignment: .leading) { + Button("Back") { + completion?(.failure(PigeonError(code: "17", message: "User cancelled operation", details: nil))) + uiViewController?.popViewController(animated: true) + }.padding(.leading, 20) + + SmileID.documentVerificationScreen( + userId: creationParams.userId ?? "user-\(UUID().uuidString)", + jobId: creationParams.jobId ?? "job-\(UUID().uuidString)", + allowNewEnroll: creationParams.allowNewEnroll, + countryCode: creationParams.countryCode, + documentType: creationParams.documentType, + idAspectRatio: creationParams.idAspectRatio, + bypassSelfieCaptureWithFile: creationParams.bypassSelfieCaptureWithFile.flatMap{ URL(string: $0) }, + captureBothSides: creationParams.captureBothSides, + allowAgentMode: creationParams.allowAgentMode, + allowGalleryUpload: creationParams.allowGalleryUpload, + showInstructions: creationParams.showInstructions, + showAttribution: creationParams.showAttribution, + skipApiSubmission: creationParams.skipApiSubmission, + extraPartnerParams: creationParams.extraPartnerParams ?? [:], + delegate: self + ).preferredColorScheme(.light) + } + } + + func didSucceed(selfie: URL, documentFrontImage: URL, documentBackImage: URL?, didSubmitDocumentVerificationJob: Bool) { + let result = DocumentCaptureResult( + selfieFile: getFilePath(fileName: selfie.absoluteString), + documentFrontFile: getFilePath(fileName: documentFrontImage.absoluteString), + didSubmitDocumentVerificationJob: didSubmitDocumentVerificationJob + ) + + completion?(.success(result)) + uiViewController?.popViewController(animated: true) + } + + func didError(error: any Error) { + completion?(.failure(PigeonError(code: "17", message: error.localizedDescription, details: nil))) + uiViewController?.popViewController(animated: true) + } +} + diff --git a/ios/Classes/SmileIDEnhancedDocumentVerificationView.swift b/ios/Classes/SmileIDEnhancedDocumentVerificationView.swift new file mode 100644 index 00000000..749b6547 --- /dev/null +++ b/ios/Classes/SmileIDEnhancedDocumentVerificationView.swift @@ -0,0 +1,53 @@ +import SwiftUI +import SmileID + +struct SmileIDEnhancedDocumentVerificationView: View, EnhancedDocumentVerificationResultDelegate, SmileIDFileUtilsProtocol { + var fileManager: FileManager = Foundation.FileManager.default + + let creationParams: DocumentVerificationEnhancedCreationParams + var completion: ((Result) -> Void)? + weak var uiViewController: UINavigationController? + + var body: some View { + VStack(alignment: .leading) { + Button("Back") { + completion?(.failure(PigeonError(code: "18", message: "User cancelled operation", details: nil))) + uiViewController?.popViewController(animated: true) + }.padding(.leading, 20) + + SmileID.enhancedDocumentVerificationScreen( + userId: creationParams.userId ?? "user-\(UUID().uuidString)", + jobId: creationParams.jobId ?? "job-\(UUID().uuidString)", + allowNewEnroll: creationParams.allowNewEnroll, + countryCode: creationParams.countryCode, + documentType: creationParams.documentType, + idAspectRatio: creationParams.idAspectRatio, + bypassSelfieCaptureWithFile: creationParams.bypassSelfieCaptureWithFile.flatMap{ URL(string: $0) }, + captureBothSides: creationParams.captureBothSides, + allowAgentMode: creationParams.allowAgentMode, + allowGalleryUpload: creationParams.allowGalleryUpload, + showInstructions: creationParams.showInstructions, + showAttribution: creationParams.showAttribution, + extraPartnerParams: creationParams.extraPartnerParams ?? [:], + delegate: self + ).preferredColorScheme(.light) + } + } + + func didSucceed(selfie: URL, documentFrontImage: URL, documentBackImage: URL?, didSubmitEnhancedDocVJob: Bool) { + let result = DocumentCaptureResult( + selfieFile: getFilePath(fileName: selfie.absoluteString), + documentFrontFile: getFilePath(fileName: documentFrontImage.absoluteString), + didSubmitEnhancedDocVJob: didSubmitEnhancedDocVJob + ) + + completion?(.success(result)) + uiViewController?.popViewController(animated: true) + } + + func didError(error: any Error) { + completion?(.failure(PigeonError(code: "18", message: error.localizedDescription, details: nil))) + uiViewController?.popViewController(animated: true) + } +} + diff --git a/ios/Classes/SmileIDMessages.g.swift b/ios/Classes/SmileIDMessages.g.swift index fdcb2bd0..213798a1 100644 --- a/ios/Classes/SmileIDMessages.g.swift +++ b/ios/Classes/SmileIDMessages.g.swift @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v16.0.5), do not edit directly. +// Autogenerated from Pigeon (v22.7.1), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -11,11 +11,36 @@ import Foundation #error("Unsupported platform.") #endif +/// Error class for passing custom error details to Dart side. +final class PigeonError: Error { + let code: String + let message: String? + let details: Any? + + init(code: String, message: String?, details: Any?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + return + "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } +} + private func wrapResult(_ result: Any?) -> [Any?] { return [result] } private func wrapError(_ error: Any) -> [Any?] { + if let pigeonError = error as? PigeonError { + return [ + pigeonError.code, + pigeonError.message, + pigeonError.details, + ] + } if let flutterError = error as? FlutterError { return [ flutterError.code, @@ -101,15 +126,13 @@ struct FlutterPartnerParams { var userId: String var extras: [String?: String?]? = nil - static func fromList(_ list: [Any?]) -> FlutterPartnerParams? { - var jobType: FlutterJobType? = nil - let jobTypeEnumVal: Int? = nilOrValue(list[0]) - if let jobTypeRawValue = jobTypeEnumVal { - jobType = FlutterJobType(rawValue: jobTypeRawValue)! - } - let jobId = list[1] as! String - let userId = list[2] as! String - let extras: [String?: String?]? = nilOrValue(list[3]) + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterPartnerParams? { + let jobType: FlutterJobType? = nilOrValue(pigeonVar_list[0]) + let jobId = pigeonVar_list[1] as! String + let userId = pigeonVar_list[2] as! String + let extras: [String?: String?]? = nilOrValue(pigeonVar_list[3]) return FlutterPartnerParams( jobType: jobType, @@ -120,7 +143,7 @@ struct FlutterPartnerParams { } func toList() -> [Any?] { return [ - jobType?.rawValue, + jobType, jobId, userId, extras, @@ -128,6 +151,478 @@ struct FlutterPartnerParams { } } +/// Generated class from Pigeon that represents data sent in messages. +struct SmartSelfieCreationParams { + var userId: String? = nil + var allowNewEnroll: Bool + var allowAgentMode: Bool + var showAttribution: Bool + var showInstructions: Bool + var skipApiSubmission: Bool + var extraPartnerParams: [String: String]? = nil + + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SmartSelfieCreationParams? { + let userId: String? = nilOrValue(pigeonVar_list[0]) + let allowNewEnroll = pigeonVar_list[1] as! Bool + let allowAgentMode = pigeonVar_list[2] as! Bool + let showAttribution = pigeonVar_list[3] as! Bool + let showInstructions = pigeonVar_list[4] as! Bool + let skipApiSubmission = pigeonVar_list[5] as! Bool + let extraPartnerParams: [String: String]? = nilOrValue(pigeonVar_list[6]) + + return SmartSelfieCreationParams( + userId: userId, + allowNewEnroll: allowNewEnroll, + allowAgentMode: allowAgentMode, + showAttribution: showAttribution, + showInstructions: showInstructions, + skipApiSubmission: skipApiSubmission, + extraPartnerParams: extraPartnerParams + ) + } + func toList() -> [Any?] { + return [ + userId, + allowNewEnroll, + allowAgentMode, + showAttribution, + showInstructions, + skipApiSubmission, + extraPartnerParams, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SmartSelfieEnhancedCreationParams { + var userId: String? = nil + var allowNewEnroll: Bool + var showAttribution: Bool + var showInstructions: Bool + var extraPartnerParams: [String: String]? = nil + + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SmartSelfieEnhancedCreationParams? { + let userId: String? = nilOrValue(pigeonVar_list[0]) + let allowNewEnroll = pigeonVar_list[1] as! Bool + let showAttribution = pigeonVar_list[2] as! Bool + let showInstructions = pigeonVar_list[3] as! Bool + let extraPartnerParams: [String: String]? = nilOrValue(pigeonVar_list[4]) + + return SmartSelfieEnhancedCreationParams( + userId: userId, + allowNewEnroll: allowNewEnroll, + showAttribution: showAttribution, + showInstructions: showInstructions, + extraPartnerParams: extraPartnerParams + ) + } + func toList() -> [Any?] { + return [ + userId, + allowNewEnroll, + showAttribution, + showInstructions, + extraPartnerParams, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SmartSelfieCaptureResult { + var selfieFile: String? = nil + var livenessFiles: [String]? = nil + var apiResponse: [String: Any?]? = nil + + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SmartSelfieCaptureResult? { + let selfieFile: String? = nilOrValue(pigeonVar_list[0]) + let livenessFiles: [String]? = nilOrValue(pigeonVar_list[1]) + let apiResponse: [String: Any?]? = nilOrValue(pigeonVar_list[2]) + + return SmartSelfieCaptureResult( + selfieFile: selfieFile, + livenessFiles: livenessFiles, + apiResponse: apiResponse + ) + } + func toList() -> [Any?] { + return [ + selfieFile, + livenessFiles, + apiResponse, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct DocumentVerificationCreationParams { + var countryCode: String + var documentType: String? = nil + var idAspectRatio: Double? = nil + var captureBothSides: Bool + var bypassSelfieCaptureWithFile: String? = nil + var userId: String? = nil + var jobId: String? = nil + var allowNewEnroll: Bool + var showAttribution: Bool + var allowGalleryUpload: Bool + var allowAgentMode: Bool + var showInstructions: Bool + var skipApiSubmission: Bool + var extraPartnerParams: [String: String]? = nil + + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> DocumentVerificationCreationParams? { + let countryCode = pigeonVar_list[0] as! String + let documentType: String? = nilOrValue(pigeonVar_list[1]) + let idAspectRatio: Double? = nilOrValue(pigeonVar_list[2]) + let captureBothSides = pigeonVar_list[3] as! Bool + let bypassSelfieCaptureWithFile: String? = nilOrValue(pigeonVar_list[4]) + let userId: String? = nilOrValue(pigeonVar_list[5]) + let jobId: String? = nilOrValue(pigeonVar_list[6]) + let allowNewEnroll = pigeonVar_list[7] as! Bool + let showAttribution = pigeonVar_list[8] as! Bool + let allowGalleryUpload = pigeonVar_list[9] as! Bool + let allowAgentMode = pigeonVar_list[10] as! Bool + let showInstructions = pigeonVar_list[11] as! Bool + let skipApiSubmission = pigeonVar_list[12] as! Bool + let extraPartnerParams: [String: String]? = nilOrValue(pigeonVar_list[13]) + + return DocumentVerificationCreationParams( + countryCode: countryCode, + documentType: documentType, + idAspectRatio: idAspectRatio, + captureBothSides: captureBothSides, + bypassSelfieCaptureWithFile: bypassSelfieCaptureWithFile, + userId: userId, + jobId: jobId, + allowNewEnroll: allowNewEnroll, + showAttribution: showAttribution, + allowGalleryUpload: allowGalleryUpload, + allowAgentMode: allowAgentMode, + showInstructions: showInstructions, + skipApiSubmission: skipApiSubmission, + extraPartnerParams: extraPartnerParams + ) + } + func toList() -> [Any?] { + return [ + countryCode, + documentType, + idAspectRatio, + captureBothSides, + bypassSelfieCaptureWithFile, + userId, + jobId, + allowNewEnroll, + showAttribution, + allowGalleryUpload, + allowAgentMode, + showInstructions, + skipApiSubmission, + extraPartnerParams, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct DocumentVerificationEnhancedCreationParams { + var countryCode: String + var documentType: String? = nil + var idAspectRatio: Double? = nil + var captureBothSides: Bool + var bypassSelfieCaptureWithFile: String? = nil + var userId: String? = nil + var jobId: String? = nil + var allowNewEnroll: Bool + var showAttribution: Bool + var allowAgentMode: Bool + var allowGalleryUpload: Bool + var showInstructions: Bool + var skipApiSubmission: Bool + var extraPartnerParams: [String: String]? = nil + + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> DocumentVerificationEnhancedCreationParams? { + let countryCode = pigeonVar_list[0] as! String + let documentType: String? = nilOrValue(pigeonVar_list[1]) + let idAspectRatio: Double? = nilOrValue(pigeonVar_list[2]) + let captureBothSides = pigeonVar_list[3] as! Bool + let bypassSelfieCaptureWithFile: String? = nilOrValue(pigeonVar_list[4]) + let userId: String? = nilOrValue(pigeonVar_list[5]) + let jobId: String? = nilOrValue(pigeonVar_list[6]) + let allowNewEnroll = pigeonVar_list[7] as! Bool + let showAttribution = pigeonVar_list[8] as! Bool + let allowAgentMode = pigeonVar_list[9] as! Bool + let allowGalleryUpload = pigeonVar_list[10] as! Bool + let showInstructions = pigeonVar_list[11] as! Bool + let skipApiSubmission = pigeonVar_list[12] as! Bool + let extraPartnerParams: [String: String]? = nilOrValue(pigeonVar_list[13]) + + return DocumentVerificationEnhancedCreationParams( + countryCode: countryCode, + documentType: documentType, + idAspectRatio: idAspectRatio, + captureBothSides: captureBothSides, + bypassSelfieCaptureWithFile: bypassSelfieCaptureWithFile, + userId: userId, + jobId: jobId, + allowNewEnroll: allowNewEnroll, + showAttribution: showAttribution, + allowAgentMode: allowAgentMode, + allowGalleryUpload: allowGalleryUpload, + showInstructions: showInstructions, + skipApiSubmission: skipApiSubmission, + extraPartnerParams: extraPartnerParams + ) + } + func toList() -> [Any?] { + return [ + countryCode, + documentType, + idAspectRatio, + captureBothSides, + bypassSelfieCaptureWithFile, + userId, + jobId, + allowNewEnroll, + showAttribution, + allowAgentMode, + allowGalleryUpload, + showInstructions, + skipApiSubmission, + extraPartnerParams, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct DocumentCaptureResult { + var selfieFile: String? = nil + var documentFrontFile: String? = nil + var livenessFiles: [String]? = nil + var documentBackFile: String? = nil + var didSubmitDocumentVerificationJob: Bool? = nil + var didSubmitEnhancedDocVJob: Bool? = nil + + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> DocumentCaptureResult? { + let selfieFile: String? = nilOrValue(pigeonVar_list[0]) + let documentFrontFile: String? = nilOrValue(pigeonVar_list[1]) + let livenessFiles: [String]? = nilOrValue(pigeonVar_list[2]) + let documentBackFile: String? = nilOrValue(pigeonVar_list[3]) + let didSubmitDocumentVerificationJob: Bool? = nilOrValue(pigeonVar_list[4]) + let didSubmitEnhancedDocVJob: Bool? = nilOrValue(pigeonVar_list[5]) + + return DocumentCaptureResult( + selfieFile: selfieFile, + documentFrontFile: documentFrontFile, + livenessFiles: livenessFiles, + documentBackFile: documentBackFile, + didSubmitDocumentVerificationJob: didSubmitDocumentVerificationJob, + didSubmitEnhancedDocVJob: didSubmitEnhancedDocVJob + ) + } + func toList() -> [Any?] { + return [ + selfieFile, + documentFrontFile, + livenessFiles, + documentBackFile, + didSubmitDocumentVerificationJob, + didSubmitEnhancedDocVJob, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct BiometricKYCCreationParams { + var country: String? = nil + var idType: String? = nil + var idNumber: String? = nil + var firstName: String? = nil + var middleName: String? = nil + var lastName: String? = nil + var dob: String? = nil + var bankCode: String? = nil + var entered: Bool? = nil + var userId: String? = nil + var jobId: String? = nil + var allowNewEnroll: Bool + var allowAgentMode: Bool + var showAttribution: Bool + var showInstructions: Bool + var extraPartnerParams: [String: String]? = nil + + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> BiometricKYCCreationParams? { + let country: String? = nilOrValue(pigeonVar_list[0]) + let idType: String? = nilOrValue(pigeonVar_list[1]) + let idNumber: String? = nilOrValue(pigeonVar_list[2]) + let firstName: String? = nilOrValue(pigeonVar_list[3]) + let middleName: String? = nilOrValue(pigeonVar_list[4]) + let lastName: String? = nilOrValue(pigeonVar_list[5]) + let dob: String? = nilOrValue(pigeonVar_list[6]) + let bankCode: String? = nilOrValue(pigeonVar_list[7]) + let entered: Bool? = nilOrValue(pigeonVar_list[8]) + let userId: String? = nilOrValue(pigeonVar_list[9]) + let jobId: String? = nilOrValue(pigeonVar_list[10]) + let allowNewEnroll = pigeonVar_list[11] as! Bool + let allowAgentMode = pigeonVar_list[12] as! Bool + let showAttribution = pigeonVar_list[13] as! Bool + let showInstructions = pigeonVar_list[14] as! Bool + let extraPartnerParams: [String: String]? = nilOrValue(pigeonVar_list[15]) + + return BiometricKYCCreationParams( + country: country, + idType: idType, + idNumber: idNumber, + firstName: firstName, + middleName: middleName, + lastName: lastName, + dob: dob, + bankCode: bankCode, + entered: entered, + userId: userId, + jobId: jobId, + allowNewEnroll: allowNewEnroll, + allowAgentMode: allowAgentMode, + showAttribution: showAttribution, + showInstructions: showInstructions, + extraPartnerParams: extraPartnerParams + ) + } + func toList() -> [Any?] { + return [ + country, + idType, + idNumber, + firstName, + middleName, + lastName, + dob, + bankCode, + entered, + userId, + jobId, + allowNewEnroll, + allowAgentMode, + showAttribution, + showInstructions, + extraPartnerParams, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct BiometricKYCCaptureResult { + var selfieFile: String? = nil + var livenessFiles: [String]? = nil + var didSubmitBiometricKycJob: Bool? = nil + + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> BiometricKYCCaptureResult? { + let selfieFile: String? = nilOrValue(pigeonVar_list[0]) + let livenessFiles: [String]? = nilOrValue(pigeonVar_list[1]) + let didSubmitBiometricKycJob: Bool? = nilOrValue(pigeonVar_list[2]) + + return BiometricKYCCaptureResult( + selfieFile: selfieFile, + livenessFiles: livenessFiles, + didSubmitBiometricKycJob: didSubmitBiometricKycJob + ) + } + func toList() -> [Any?] { + return [ + selfieFile, + livenessFiles, + didSubmitBiometricKycJob, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SelfieCaptureViewCreationParams { + var showConfirmationDialog: Bool + var showInstructions: Bool + var showAttribution: Bool + var allowAgentMode: Bool + + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SelfieCaptureViewCreationParams? { + let showConfirmationDialog = pigeonVar_list[0] as! Bool + let showInstructions = pigeonVar_list[1] as! Bool + let showAttribution = pigeonVar_list[2] as! Bool + let allowAgentMode = pigeonVar_list[3] as! Bool + + return SelfieCaptureViewCreationParams( + showConfirmationDialog: showConfirmationDialog, + showInstructions: showInstructions, + showAttribution: showAttribution, + allowAgentMode: allowAgentMode + ) + } + func toList() -> [Any?] { + return [ + showConfirmationDialog, + showInstructions, + showAttribution, + allowAgentMode, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct DocumentCaptureCreationParams { + var isDocumentFrontSide: Bool + var showInstructions: Bool + var showAttribution: Bool + var allowGalleryUpload: Bool + var showConfirmationDialog: Bool + var idAspectRatio: Double? = nil + + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> DocumentCaptureCreationParams? { + let isDocumentFrontSide = pigeonVar_list[0] as! Bool + let showInstructions = pigeonVar_list[1] as! Bool + let showAttribution = pigeonVar_list[2] as! Bool + let allowGalleryUpload = pigeonVar_list[3] as! Bool + let showConfirmationDialog = pigeonVar_list[4] as! Bool + let idAspectRatio: Double? = nilOrValue(pigeonVar_list[5]) + + return DocumentCaptureCreationParams( + isDocumentFrontSide: isDocumentFrontSide, + showInstructions: showInstructions, + showAttribution: showAttribution, + allowGalleryUpload: allowGalleryUpload, + showConfirmationDialog: showConfirmationDialog, + idAspectRatio: idAspectRatio + ) + } + func toList() -> [Any?] { + return [ + isDocumentFrontSide, + showInstructions, + showAttribution, + allowGalleryUpload, + showConfirmationDialog, + idAspectRatio, + ] + } +} + /// The Auth Smile request. Auth Smile serves multiple purposes: /// /// - It is used to fetch the signature needed for subsequent API requests @@ -155,13 +650,15 @@ struct FlutterAuthenticationRequest { var jobId: String? = nil var userId: String? = nil - static func fromList(_ list: [Any?]) -> FlutterAuthenticationRequest? { - let jobType = FlutterJobType(rawValue: list[0] as! Int)! - let country: String? = nilOrValue(list[1]) - let idType: String? = nilOrValue(list[2]) - let updateEnrolledImage: Bool? = nilOrValue(list[3]) - let jobId: String? = nilOrValue(list[4]) - let userId: String? = nilOrValue(list[5]) + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterAuthenticationRequest? { + let jobType = pigeonVar_list[0] as! FlutterJobType + let country: String? = nilOrValue(pigeonVar_list[1]) + let idType: String? = nilOrValue(pigeonVar_list[2]) + let updateEnrolledImage: Bool? = nilOrValue(pigeonVar_list[3]) + let jobId: String? = nilOrValue(pigeonVar_list[4]) + let userId: String? = nilOrValue(pigeonVar_list[5]) return FlutterAuthenticationRequest( jobType: jobType, @@ -174,7 +671,7 @@ struct FlutterAuthenticationRequest { } func toList() -> [Any?] { return [ - jobType.rawValue, + jobType, country, idType, updateEnrolledImage, @@ -200,16 +697,15 @@ struct FlutterAuthenticationResponse { var callbackUrl: String? = nil var consentInfo: FlutterConsentInfo? = nil - static func fromList(_ list: [Any?]) -> FlutterAuthenticationResponse? { - let success = list[0] as! Bool - let signature = list[1] as! String - let timestamp = list[2] as! String - let partnerParams = FlutterPartnerParams.fromList(list[3] as! [Any?])! - let callbackUrl: String? = nilOrValue(list[4]) - var consentInfo: FlutterConsentInfo? = nil - if let consentInfoList: [Any?] = nilOrValue(list[5]) { - consentInfo = FlutterConsentInfo.fromList(consentInfoList) - } + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterAuthenticationResponse? { + let success = pigeonVar_list[0] as! Bool + let signature = pigeonVar_list[1] as! String + let timestamp = pigeonVar_list[2] as! String + let partnerParams = pigeonVar_list[3] as! FlutterPartnerParams + let callbackUrl: String? = nilOrValue(pigeonVar_list[4]) + let consentInfo: FlutterConsentInfo? = nilOrValue(pigeonVar_list[5]) return FlutterAuthenticationResponse( success: success, @@ -225,9 +721,9 @@ struct FlutterAuthenticationResponse { success, signature, timestamp, - partnerParams.toList(), + partnerParams, callbackUrl, - consentInfo?.toList(), + consentInfo, ] } } @@ -241,13 +737,15 @@ struct FlutterPrepUploadRequest { var timestamp: String var signature: String - static func fromList(_ list: [Any?]) -> FlutterPrepUploadRequest? { - let partnerParams = FlutterPartnerParams.fromList(list[0] as! [Any?])! - let callbackUrl: String? = nilOrValue(list[1]) - let allowNewEnroll = list[2] as! Bool - let partnerId = list[3] as! String - let timestamp = list[4] as! String - let signature = list[5] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterPrepUploadRequest? { + let partnerParams = pigeonVar_list[0] as! FlutterPartnerParams + let callbackUrl: String? = nilOrValue(pigeonVar_list[1]) + let allowNewEnroll = pigeonVar_list[2] as! Bool + let partnerId = pigeonVar_list[3] as! String + let timestamp = pigeonVar_list[4] as! String + let signature = pigeonVar_list[5] as! String return FlutterPrepUploadRequest( partnerParams: partnerParams, @@ -260,7 +758,7 @@ struct FlutterPrepUploadRequest { } func toList() -> [Any?] { return [ - partnerParams.toList(), + partnerParams, callbackUrl, allowNewEnroll, partnerId, @@ -277,11 +775,13 @@ struct FlutterPrepUploadResponse { var uploadUrl: String var smileJobId: String - static func fromList(_ list: [Any?]) -> FlutterPrepUploadResponse? { - let code = list[0] as! String - let refId = list[1] as! String - let uploadUrl = list[2] as! String - let smileJobId = list[3] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterPrepUploadResponse? { + let code = pigeonVar_list[0] as! String + let refId = pigeonVar_list[1] as! String + let uploadUrl = pigeonVar_list[2] as! String + let smileJobId = pigeonVar_list[3] as! String return FlutterPrepUploadResponse( code: code, @@ -305,12 +805,11 @@ struct FlutterUploadRequest { var images: [FlutterUploadImageInfo?] var idInfo: FlutterIdInfo? = nil - static func fromList(_ list: [Any?]) -> FlutterUploadRequest? { - let images = list[0] as! [FlutterUploadImageInfo?] - var idInfo: FlutterIdInfo? = nil - if let idInfoList: [Any?] = nilOrValue(list[1]) { - idInfo = FlutterIdInfo.fromList(idInfoList) - } + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterUploadRequest? { + let images = pigeonVar_list[0] as! [FlutterUploadImageInfo?] + let idInfo: FlutterIdInfo? = nilOrValue(pigeonVar_list[1]) return FlutterUploadRequest( images: images, @@ -320,7 +819,7 @@ struct FlutterUploadRequest { func toList() -> [Any?] { return [ images, - idInfo?.toList(), + idInfo, ] } } @@ -330,9 +829,11 @@ struct FlutterUploadImageInfo { var imageTypeId: FlutterImageType var imageName: String - static func fromList(_ list: [Any?]) -> FlutterUploadImageInfo? { - let imageTypeId = FlutterImageType(rawValue: list[0] as! Int)! - let imageName = list[1] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterUploadImageInfo? { + let imageTypeId = pigeonVar_list[0] as! FlutterImageType + let imageName = pigeonVar_list[1] as! String return FlutterUploadImageInfo( imageTypeId: imageTypeId, @@ -341,7 +842,7 @@ struct FlutterUploadImageInfo { } func toList() -> [Any?] { return [ - imageTypeId.rawValue, + imageTypeId, imageName, ] } @@ -359,16 +860,18 @@ struct FlutterIdInfo { var bankCode: String? = nil var entered: Bool? = nil - static func fromList(_ list: [Any?]) -> FlutterIdInfo? { - let country = list[0] as! String - let idType: String? = nilOrValue(list[1]) - let idNumber: String? = nilOrValue(list[2]) - let firstName: String? = nilOrValue(list[3]) - let middleName: String? = nilOrValue(list[4]) - let lastName: String? = nilOrValue(list[5]) - let dob: String? = nilOrValue(list[6]) - let bankCode: String? = nilOrValue(list[7]) - let entered: Bool? = nilOrValue(list[8]) + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterIdInfo? { + let country = pigeonVar_list[0] as! String + let idType: String? = nilOrValue(pigeonVar_list[1]) + let idNumber: String? = nilOrValue(pigeonVar_list[2]) + let firstName: String? = nilOrValue(pigeonVar_list[3]) + let middleName: String? = nilOrValue(pigeonVar_list[4]) + let lastName: String? = nilOrValue(pigeonVar_list[5]) + let dob: String? = nilOrValue(pigeonVar_list[6]) + let bankCode: String? = nilOrValue(pigeonVar_list[7]) + let entered: Bool? = nilOrValue(pigeonVar_list[8]) return FlutterIdInfo( country: country, @@ -412,19 +915,21 @@ struct FlutterEnhancedKycResponse { var dob: String? = nil var base64Photo: String? = nil - static func fromList(_ list: [Any?]) -> FlutterEnhancedKycResponse? { - let smileJobId = list[0] as! String - let partnerParams = FlutterPartnerParams.fromList(list[1] as! [Any?])! - let resultText = list[2] as! String - let resultCode = list[3] as! String - let actions = FlutterActions.fromList(list[4] as! [Any?])! - let country = list[5] as! String - let idType = list[6] as! String - let idNumber = list[7] as! String - let fullName: String? = nilOrValue(list[8]) - let expirationDate: String? = nilOrValue(list[9]) - let dob: String? = nilOrValue(list[10]) - let base64Photo: String? = nilOrValue(list[11]) + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterEnhancedKycResponse? { + let smileJobId = pigeonVar_list[0] as! String + let partnerParams = pigeonVar_list[1] as! FlutterPartnerParams + let resultText = pigeonVar_list[2] as! String + let resultCode = pigeonVar_list[3] as! String + let actions = pigeonVar_list[4] as! FlutterActions + let country = pigeonVar_list[5] as! String + let idType = pigeonVar_list[6] as! String + let idNumber = pigeonVar_list[7] as! String + let fullName: String? = nilOrValue(pigeonVar_list[8]) + let expirationDate: String? = nilOrValue(pigeonVar_list[9]) + let dob: String? = nilOrValue(pigeonVar_list[10]) + let base64Photo: String? = nilOrValue(pigeonVar_list[11]) return FlutterEnhancedKycResponse( smileJobId: smileJobId, @@ -444,10 +949,10 @@ struct FlutterEnhancedKycResponse { func toList() -> [Any?] { return [ smileJobId, - partnerParams.toList(), + partnerParams, resultText, resultCode, - actions.toList(), + actions, country, idType, idNumber, @@ -479,24 +984,26 @@ struct FlutterActions { var verifyDocument: FlutterActionResult var verifyIdNumber: FlutterActionResult - static func fromList(_ list: [Any?]) -> FlutterActions? { - let documentCheck = FlutterActionResult(rawValue: list[0] as! Int)! - let humanReviewCompare = FlutterActionResult(rawValue: list[1] as! Int)! - let humanReviewDocumentCheck = FlutterActionResult(rawValue: list[2] as! Int)! - let humanReviewLivenessCheck = FlutterActionResult(rawValue: list[3] as! Int)! - let humanReviewSelfieCheck = FlutterActionResult(rawValue: list[4] as! Int)! - let humanReviewUpdateSelfie = FlutterActionResult(rawValue: list[5] as! Int)! - let livenessCheck = FlutterActionResult(rawValue: list[6] as! Int)! - let registerSelfie = FlutterActionResult(rawValue: list[7] as! Int)! - let returnPersonalInfo = FlutterActionResult(rawValue: list[8] as! Int)! - let selfieCheck = FlutterActionResult(rawValue: list[9] as! Int)! - let selfieProvided = FlutterActionResult(rawValue: list[10] as! Int)! - let selfieToIdAuthorityCompare = FlutterActionResult(rawValue: list[11] as! Int)! - let selfieToIdCardCompare = FlutterActionResult(rawValue: list[12] as! Int)! - let selfieToRegisteredSelfieCompare = FlutterActionResult(rawValue: list[13] as! Int)! - let updateRegisteredSelfieOnFile = FlutterActionResult(rawValue: list[14] as! Int)! - let verifyDocument = FlutterActionResult(rawValue: list[15] as! Int)! - let verifyIdNumber = FlutterActionResult(rawValue: list[16] as! Int)! + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterActions? { + let documentCheck = pigeonVar_list[0] as! FlutterActionResult + let humanReviewCompare = pigeonVar_list[1] as! FlutterActionResult + let humanReviewDocumentCheck = pigeonVar_list[2] as! FlutterActionResult + let humanReviewLivenessCheck = pigeonVar_list[3] as! FlutterActionResult + let humanReviewSelfieCheck = pigeonVar_list[4] as! FlutterActionResult + let humanReviewUpdateSelfie = pigeonVar_list[5] as! FlutterActionResult + let livenessCheck = pigeonVar_list[6] as! FlutterActionResult + let registerSelfie = pigeonVar_list[7] as! FlutterActionResult + let returnPersonalInfo = pigeonVar_list[8] as! FlutterActionResult + let selfieCheck = pigeonVar_list[9] as! FlutterActionResult + let selfieProvided = pigeonVar_list[10] as! FlutterActionResult + let selfieToIdAuthorityCompare = pigeonVar_list[11] as! FlutterActionResult + let selfieToIdCardCompare = pigeonVar_list[12] as! FlutterActionResult + let selfieToRegisteredSelfieCompare = pigeonVar_list[13] as! FlutterActionResult + let updateRegisteredSelfieOnFile = pigeonVar_list[14] as! FlutterActionResult + let verifyDocument = pigeonVar_list[15] as! FlutterActionResult + let verifyIdNumber = pigeonVar_list[16] as! FlutterActionResult return FlutterActions( documentCheck: documentCheck, @@ -520,23 +1027,23 @@ struct FlutterActions { } func toList() -> [Any?] { return [ - documentCheck.rawValue, - humanReviewCompare.rawValue, - humanReviewDocumentCheck.rawValue, - humanReviewLivenessCheck.rawValue, - humanReviewSelfieCheck.rawValue, - humanReviewUpdateSelfie.rawValue, - livenessCheck.rawValue, - registerSelfie.rawValue, - returnPersonalInfo.rawValue, - selfieCheck.rawValue, - selfieProvided.rawValue, - selfieToIdAuthorityCompare.rawValue, - selfieToIdCardCompare.rawValue, - selfieToRegisteredSelfieCompare.rawValue, - updateRegisteredSelfieOnFile.rawValue, - verifyDocument.rawValue, - verifyIdNumber.rawValue, + documentCheck, + humanReviewCompare, + humanReviewDocumentCheck, + humanReviewLivenessCheck, + humanReviewSelfieCheck, + humanReviewUpdateSelfie, + livenessCheck, + registerSelfie, + returnPersonalInfo, + selfieCheck, + selfieProvided, + selfieToIdAuthorityCompare, + selfieToIdCardCompare, + selfieToRegisteredSelfieCompare, + updateRegisteredSelfieOnFile, + verifyDocument, + verifyIdNumber, ] } } @@ -549,9 +1056,11 @@ struct FlutterConsentInfo { var canAccess: Bool var consentRequired: Bool - static func fromList(_ list: [Any?]) -> FlutterConsentInfo? { - let canAccess = list[0] as! Bool - let consentRequired = list[1] as! Bool + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterConsentInfo? { + let canAccess = pigeonVar_list[0] as! Bool + let consentRequired = pigeonVar_list[1] as! Bool return FlutterConsentInfo( canAccess: canAccess, @@ -585,20 +1094,22 @@ struct FlutterEnhancedKycRequest { var timestamp: String var signature: String - static func fromList(_ list: [Any?]) -> FlutterEnhancedKycRequest? { - let country = list[0] as! String - let idType = list[1] as! String - let idNumber = list[2] as! String - let firstName: String? = nilOrValue(list[3]) - let middleName: String? = nilOrValue(list[4]) - let lastName: String? = nilOrValue(list[5]) - let dob: String? = nilOrValue(list[6]) - let phoneNumber: String? = nilOrValue(list[7]) - let bankCode: String? = nilOrValue(list[8]) - let callbackUrl: String? = nilOrValue(list[9]) - let partnerParams = FlutterPartnerParams.fromList(list[10] as! [Any?])! - let timestamp = list[11] as! String - let signature = list[12] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterEnhancedKycRequest? { + let country = pigeonVar_list[0] as! String + let idType = pigeonVar_list[1] as! String + let idNumber = pigeonVar_list[2] as! String + let firstName: String? = nilOrValue(pigeonVar_list[3]) + let middleName: String? = nilOrValue(pigeonVar_list[4]) + let lastName: String? = nilOrValue(pigeonVar_list[5]) + let dob: String? = nilOrValue(pigeonVar_list[6]) + let phoneNumber: String? = nilOrValue(pigeonVar_list[7]) + let bankCode: String? = nilOrValue(pigeonVar_list[8]) + let callbackUrl: String? = nilOrValue(pigeonVar_list[9]) + let partnerParams = pigeonVar_list[10] as! FlutterPartnerParams + let timestamp = pigeonVar_list[11] as! String + let signature = pigeonVar_list[12] as! String return FlutterEnhancedKycRequest( country: country, @@ -628,7 +1139,7 @@ struct FlutterEnhancedKycRequest { phoneNumber, bankCode, callbackUrl, - partnerParams.toList(), + partnerParams, timestamp, signature, ] @@ -639,8 +1150,10 @@ struct FlutterEnhancedKycRequest { struct FlutterEnhancedKycAsyncResponse { var success: Bool - static func fromList(_ list: [Any?]) -> FlutterEnhancedKycAsyncResponse? { - let success = list[0] as! Bool + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterEnhancedKycAsyncResponse? { + let success = pigeonVar_list[0] as! Bool return FlutterEnhancedKycAsyncResponse( success: success @@ -658,9 +1171,11 @@ struct FlutterImageLinks { var selfieImageUrl: String? = nil var error: String? = nil - static func fromList(_ list: [Any?]) -> FlutterImageLinks? { - let selfieImageUrl: String? = nilOrValue(list[0]) - let error: String? = nilOrValue(list[1]) + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterImageLinks? { + let selfieImageUrl: String? = nilOrValue(pigeonVar_list[0]) + let error: String? = nilOrValue(pigeonVar_list[1]) return FlutterImageLinks( selfieImageUrl: selfieImageUrl, @@ -679,8 +1194,10 @@ struct FlutterImageLinks { struct FlutterAntifraud { var suspectUsers: [FlutterSuspectUser?] - static func fromList(_ list: [Any?]) -> FlutterAntifraud? { - let suspectUsers = list[0] as! [FlutterSuspectUser?] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterAntifraud? { + let suspectUsers = pigeonVar_list[0] as! [FlutterSuspectUser?] return FlutterAntifraud( suspectUsers: suspectUsers @@ -698,9 +1215,11 @@ struct FlutterSuspectUser { var reason: String var userId: String - static func fromList(_ list: [Any?]) -> FlutterSuspectUser? { - let reason = list[0] as! String - let userId = list[1] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterSuspectUser? { + let reason = pigeonVar_list[0] as! String + let userId = pigeonVar_list[1] as! String return FlutterSuspectUser( reason: reason, @@ -725,14 +1244,16 @@ struct FlutterJobStatusRequest { var timestamp: String var signature: String - static func fromList(_ list: [Any?]) -> FlutterJobStatusRequest? { - let userId = list[0] as! String - let jobId = list[1] as! String - let includeImageLinks = list[2] as! Bool - let includeHistory = list[3] as! Bool - let partnerId = list[4] as! String - let timestamp = list[5] as! String - let signature = list[6] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterJobStatusRequest? { + let userId = pigeonVar_list[0] as! String + let jobId = pigeonVar_list[1] as! String + let includeImageLinks = pigeonVar_list[2] as! Bool + let includeHistory = pigeonVar_list[3] as! Bool + let partnerId = pigeonVar_list[4] as! String + let timestamp = pigeonVar_list[5] as! String + let signature = pigeonVar_list[6] as! String return FlutterJobStatusRequest( userId: userId, @@ -766,13 +1287,15 @@ struct FlutterSmartSelfieJobResult { var partnerParams: FlutterPartnerParams var confidence: Double? = nil - static func fromList(_ list: [Any?]) -> FlutterSmartSelfieJobResult? { - let actions = FlutterActions.fromList(list[0] as! [Any?])! - let resultCode = list[1] as! String - let resultText = list[2] as! String - let smileJobId = list[3] as! String - let partnerParams = FlutterPartnerParams.fromList(list[4] as! [Any?])! - let confidence: Double? = nilOrValue(list[5]) + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterSmartSelfieJobResult? { + let actions = pigeonVar_list[0] as! FlutterActions + let resultCode = pigeonVar_list[1] as! String + let resultText = pigeonVar_list[2] as! String + let smileJobId = pigeonVar_list[3] as! String + let partnerParams = pigeonVar_list[4] as! FlutterPartnerParams + let confidence: Double? = nilOrValue(pigeonVar_list[5]) return FlutterSmartSelfieJobResult( actions: actions, @@ -785,11 +1308,11 @@ struct FlutterSmartSelfieJobResult { } func toList() -> [Any?] { return [ - actions.toList(), + actions, resultCode, resultText, smileJobId, - partnerParams.toList(), + partnerParams, confidence, ] } @@ -806,21 +1329,17 @@ struct FlutterSmartSelfieJobStatusResponse { var history: [FlutterSmartSelfieJobResult?]? = nil var imageLinks: FlutterImageLinks? = nil - static func fromList(_ list: [Any?]) -> FlutterSmartSelfieJobStatusResponse? { - let timestamp = list[0] as! String - let jobComplete = list[1] as! Bool - let jobSuccess = list[2] as! Bool - let code = list[3] as! String - var result: FlutterSmartSelfieJobResult? = nil - if let resultList: [Any?] = nilOrValue(list[4]) { - result = FlutterSmartSelfieJobResult.fromList(resultList) - } - let resultString: String? = nilOrValue(list[5]) - let history: [FlutterSmartSelfieJobResult?]? = nilOrValue(list[6]) - var imageLinks: FlutterImageLinks? = nil - if let imageLinksList: [Any?] = nilOrValue(list[7]) { - imageLinks = FlutterImageLinks.fromList(imageLinksList) - } + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterSmartSelfieJobStatusResponse? { + let timestamp = pigeonVar_list[0] as! String + let jobComplete = pigeonVar_list[1] as! Bool + let jobSuccess = pigeonVar_list[2] as! Bool + let code = pigeonVar_list[3] as! String + let result: FlutterSmartSelfieJobResult? = nilOrValue(pigeonVar_list[4]) + let resultString: String? = nilOrValue(pigeonVar_list[5]) + let history: [FlutterSmartSelfieJobResult?]? = nilOrValue(pigeonVar_list[6]) + let imageLinks: FlutterImageLinks? = nilOrValue(pigeonVar_list[7]) return FlutterSmartSelfieJobStatusResponse( timestamp: timestamp, @@ -839,10 +1358,10 @@ struct FlutterSmartSelfieJobStatusResponse { jobComplete, jobSuccess, code, - result?.toList(), + result, resultString, history, - imageLinks?.toList(), + imageLinks, ] } } @@ -860,17 +1379,19 @@ struct FlutterSmartSelfieResponse { var updatedAt: String var userId: String - static func fromList(_ list: [Any?]) -> FlutterSmartSelfieResponse? { - let code = list[0] as! String - let createdAt = list[1] as! String - let jobId = list[2] as! String - let jobType = FlutterJobTypeV2(rawValue: list[3] as! Int)! - let message = list[4] as! String - let partnerId = list[5] as! String - let partnerParams: [String?: String?]? = nilOrValue(list[6]) - let status = FlutterSmartSelfieStatus(rawValue: list[7] as! Int)! - let updatedAt = list[8] as! String - let userId = list[9] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterSmartSelfieResponse? { + let code = pigeonVar_list[0] as! String + let createdAt = pigeonVar_list[1] as! String + let jobId = pigeonVar_list[2] as! String + let jobType = pigeonVar_list[3] as! FlutterJobTypeV2 + let message = pigeonVar_list[4] as! String + let partnerId = pigeonVar_list[5] as! String + let partnerParams: [String?: String?]? = nilOrValue(pigeonVar_list[6]) + let status = pigeonVar_list[7] as! FlutterSmartSelfieStatus + let updatedAt = pigeonVar_list[8] as! String + let userId = pigeonVar_list[9] as! String return FlutterSmartSelfieResponse( code: code, @@ -890,11 +1411,11 @@ struct FlutterSmartSelfieResponse { code, createdAt, jobId, - jobType.rawValue, + jobType, message, partnerId, partnerParams, - status.rawValue, + status, updatedAt, userId, ] @@ -920,23 +1441,25 @@ struct FlutterDocumentVerificationJobResult { var phoneNumber2: String? = nil var address: String? = nil - static func fromList(_ list: [Any?]) -> FlutterDocumentVerificationJobResult? { - let actions = FlutterActions.fromList(list[0] as! [Any?])! - let resultCode = list[1] as! String - let resultText = list[2] as! String - let smileJobId = list[3] as! String - let partnerParams = FlutterPartnerParams.fromList(list[4] as! [Any?])! - let country: String? = nilOrValue(list[5]) - let idType: String? = nilOrValue(list[6]) - let idNumber: String? = nilOrValue(list[7]) - let fullName: String? = nilOrValue(list[8]) - let dob: String? = nilOrValue(list[9]) - let gender: String? = nilOrValue(list[10]) - let expirationDate: String? = nilOrValue(list[11]) - let documentImageBase64: String? = nilOrValue(list[12]) - let phoneNumber: String? = nilOrValue(list[13]) - let phoneNumber2: String? = nilOrValue(list[14]) - let address: String? = nilOrValue(list[15]) + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterDocumentVerificationJobResult? { + let actions = pigeonVar_list[0] as! FlutterActions + let resultCode = pigeonVar_list[1] as! String + let resultText = pigeonVar_list[2] as! String + let smileJobId = pigeonVar_list[3] as! String + let partnerParams = pigeonVar_list[4] as! FlutterPartnerParams + let country: String? = nilOrValue(pigeonVar_list[5]) + let idType: String? = nilOrValue(pigeonVar_list[6]) + let idNumber: String? = nilOrValue(pigeonVar_list[7]) + let fullName: String? = nilOrValue(pigeonVar_list[8]) + let dob: String? = nilOrValue(pigeonVar_list[9]) + let gender: String? = nilOrValue(pigeonVar_list[10]) + let expirationDate: String? = nilOrValue(pigeonVar_list[11]) + let documentImageBase64: String? = nilOrValue(pigeonVar_list[12]) + let phoneNumber: String? = nilOrValue(pigeonVar_list[13]) + let phoneNumber2: String? = nilOrValue(pigeonVar_list[14]) + let address: String? = nilOrValue(pigeonVar_list[15]) return FlutterDocumentVerificationJobResult( actions: actions, @@ -959,11 +1482,11 @@ struct FlutterDocumentVerificationJobResult { } func toList() -> [Any?] { return [ - actions.toList(), + actions, resultCode, resultText, smileJobId, - partnerParams.toList(), + partnerParams, country, idType, idNumber, @@ -990,21 +1513,17 @@ struct FlutterDocumentVerificationJobStatusResponse { var history: [FlutterDocumentVerificationJobResult?]? = nil var imageLinks: FlutterImageLinks? = nil - static func fromList(_ list: [Any?]) -> FlutterDocumentVerificationJobStatusResponse? { - let timestamp = list[0] as! String - let jobComplete = list[1] as! Bool - let jobSuccess = list[2] as! Bool - let code = list[3] as! String - var result: FlutterDocumentVerificationJobResult? = nil - if let resultList: [Any?] = nilOrValue(list[4]) { - result = FlutterDocumentVerificationJobResult.fromList(resultList) - } - let resultString: String? = nilOrValue(list[5]) - let history: [FlutterDocumentVerificationJobResult?]? = nilOrValue(list[6]) - var imageLinks: FlutterImageLinks? = nil - if let imageLinksList: [Any?] = nilOrValue(list[7]) { - imageLinks = FlutterImageLinks.fromList(imageLinksList) - } + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterDocumentVerificationJobStatusResponse? { + let timestamp = pigeonVar_list[0] as! String + let jobComplete = pigeonVar_list[1] as! Bool + let jobSuccess = pigeonVar_list[2] as! Bool + let code = pigeonVar_list[3] as! String + let result: FlutterDocumentVerificationJobResult? = nilOrValue(pigeonVar_list[4]) + let resultString: String? = nilOrValue(pigeonVar_list[5]) + let history: [FlutterDocumentVerificationJobResult?]? = nilOrValue(pigeonVar_list[6]) + let imageLinks: FlutterImageLinks? = nilOrValue(pigeonVar_list[7]) return FlutterDocumentVerificationJobStatusResponse( timestamp: timestamp, @@ -1023,10 +1542,10 @@ struct FlutterDocumentVerificationJobStatusResponse { jobComplete, jobSuccess, code, - result?.toList(), + result, resultString, history, - imageLinks?.toList(), + imageLinks, ] } } @@ -1057,33 +1576,32 @@ struct FlutterBiometricKycJobResult { var idNumberPreviouslyRegistered: Bool? = nil var previousRegistrantsUserIds: [String?]? = nil - static func fromList(_ list: [Any?]) -> FlutterBiometricKycJobResult? { - let actions = FlutterActions.fromList(list[0] as! [Any?])! - let resultCode = list[1] as! String - let resultText = list[2] as! String - let resultType = list[3] as! String - let smileJobId = list[4] as! String - let partnerParams = FlutterPartnerParams.fromList(list[5] as! [Any?])! - var antifraud: FlutterAntifraud? = nil - if let antifraudList: [Any?] = nilOrValue(list[6]) { - antifraud = FlutterAntifraud.fromList(antifraudList) - } - let dob: String? = nilOrValue(list[7]) - let photoBase64: String? = nilOrValue(list[8]) - let gender: String? = nilOrValue(list[9]) - let idType: String? = nilOrValue(list[10]) - let address: String? = nilOrValue(list[11]) - let country: String? = nilOrValue(list[12]) - let documentImageBase64: String? = nilOrValue(list[13]) - let fullData: [String?: String?]? = nilOrValue(list[14]) - let fullName: String? = nilOrValue(list[15]) - let idNumber: String? = nilOrValue(list[16]) - let phoneNumber: String? = nilOrValue(list[17]) - let phoneNumber2: String? = nilOrValue(list[18]) - let expirationDate: String? = nilOrValue(list[19]) - let secondaryIdNumber: String? = nilOrValue(list[20]) - let idNumberPreviouslyRegistered: Bool? = nilOrValue(list[21]) - let previousRegistrantsUserIds: [String?]? = nilOrValue(list[22]) + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterBiometricKycJobResult? { + let actions = pigeonVar_list[0] as! FlutterActions + let resultCode = pigeonVar_list[1] as! String + let resultText = pigeonVar_list[2] as! String + let resultType = pigeonVar_list[3] as! String + let smileJobId = pigeonVar_list[4] as! String + let partnerParams = pigeonVar_list[5] as! FlutterPartnerParams + let antifraud: FlutterAntifraud? = nilOrValue(pigeonVar_list[6]) + let dob: String? = nilOrValue(pigeonVar_list[7]) + let photoBase64: String? = nilOrValue(pigeonVar_list[8]) + let gender: String? = nilOrValue(pigeonVar_list[9]) + let idType: String? = nilOrValue(pigeonVar_list[10]) + let address: String? = nilOrValue(pigeonVar_list[11]) + let country: String? = nilOrValue(pigeonVar_list[12]) + let documentImageBase64: String? = nilOrValue(pigeonVar_list[13]) + let fullData: [String?: String?]? = nilOrValue(pigeonVar_list[14]) + let fullName: String? = nilOrValue(pigeonVar_list[15]) + let idNumber: String? = nilOrValue(pigeonVar_list[16]) + let phoneNumber: String? = nilOrValue(pigeonVar_list[17]) + let phoneNumber2: String? = nilOrValue(pigeonVar_list[18]) + let expirationDate: String? = nilOrValue(pigeonVar_list[19]) + let secondaryIdNumber: String? = nilOrValue(pigeonVar_list[20]) + let idNumberPreviouslyRegistered: Bool? = nilOrValue(pigeonVar_list[21]) + let previousRegistrantsUserIds: [String?]? = nilOrValue(pigeonVar_list[22]) return FlutterBiometricKycJobResult( actions: actions, @@ -1113,13 +1631,13 @@ struct FlutterBiometricKycJobResult { } func toList() -> [Any?] { return [ - actions.toList(), + actions, resultCode, resultText, resultType, smileJobId, - partnerParams.toList(), - antifraud?.toList(), + partnerParams, + antifraud, dob, photoBase64, gender, @@ -1151,21 +1669,17 @@ struct FlutterBiometricKycJobStatusResponse { var history: [FlutterBiometricKycJobResult?]? = nil var imageLinks: FlutterImageLinks? = nil - static func fromList(_ list: [Any?]) -> FlutterBiometricKycJobStatusResponse? { - let timestamp = list[0] as! String - let jobComplete = list[1] as! Bool - let jobSuccess = list[2] as! Bool - let code = list[3] as! String - var result: FlutterBiometricKycJobResult? = nil - if let resultList: [Any?] = nilOrValue(list[4]) { - result = FlutterBiometricKycJobResult.fromList(resultList) - } - let resultString: String? = nilOrValue(list[5]) - let history: [FlutterBiometricKycJobResult?]? = nilOrValue(list[6]) - var imageLinks: FlutterImageLinks? = nil - if let imageLinksList: [Any?] = nilOrValue(list[7]) { - imageLinks = FlutterImageLinks.fromList(imageLinksList) - } + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterBiometricKycJobStatusResponse? { + let timestamp = pigeonVar_list[0] as! String + let jobComplete = pigeonVar_list[1] as! Bool + let jobSuccess = pigeonVar_list[2] as! Bool + let code = pigeonVar_list[3] as! String + let result: FlutterBiometricKycJobResult? = nilOrValue(pigeonVar_list[4]) + let resultString: String? = nilOrValue(pigeonVar_list[5]) + let history: [FlutterBiometricKycJobResult?]? = nilOrValue(pigeonVar_list[6]) + let imageLinks: FlutterImageLinks? = nilOrValue(pigeonVar_list[7]) return FlutterBiometricKycJobStatusResponse( timestamp: timestamp, @@ -1184,10 +1698,10 @@ struct FlutterBiometricKycJobStatusResponse { jobComplete, jobSuccess, code, - result?.toList(), + result, resultString, history, - imageLinks?.toList(), + imageLinks, ] } } @@ -1218,33 +1732,32 @@ struct FlutterEnhancedDocumentVerificationJobResult { var idNumberPreviouslyRegistered: Bool? = nil var previousRegistrantsUserIds: [String?]? = nil - static func fromList(_ list: [Any?]) -> FlutterEnhancedDocumentVerificationJobResult? { - let actions = FlutterActions.fromList(list[0] as! [Any?])! - let resultCode = list[1] as! String - let resultText = list[2] as! String - let resultType = list[3] as! String - let smileJobId = list[4] as! String - let partnerParams = FlutterPartnerParams.fromList(list[5] as! [Any?])! - var antifraud: FlutterAntifraud? = nil - if let antifraudList: [Any?] = nilOrValue(list[6]) { - antifraud = FlutterAntifraud.fromList(antifraudList) - } - let dob: String? = nilOrValue(list[7]) - let photoBase64: String? = nilOrValue(list[8]) - let gender: String? = nilOrValue(list[9]) - let idType: String? = nilOrValue(list[10]) - let address: String? = nilOrValue(list[11]) - let country: String? = nilOrValue(list[12]) - let documentImageBase64: String? = nilOrValue(list[13]) - let fullData: [String?: String?]? = nilOrValue(list[14]) - let fullName: String? = nilOrValue(list[15]) - let idNumber: String? = nilOrValue(list[16]) - let phoneNumber: String? = nilOrValue(list[17]) - let phoneNumber2: String? = nilOrValue(list[18]) - let expirationDate: String? = nilOrValue(list[19]) - let secondaryIdNumber: String? = nilOrValue(list[20]) - let idNumberPreviouslyRegistered: Bool? = nilOrValue(list[21]) - let previousRegistrantsUserIds: [String?]? = nilOrValue(list[22]) + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterEnhancedDocumentVerificationJobResult? { + let actions = pigeonVar_list[0] as! FlutterActions + let resultCode = pigeonVar_list[1] as! String + let resultText = pigeonVar_list[2] as! String + let resultType = pigeonVar_list[3] as! String + let smileJobId = pigeonVar_list[4] as! String + let partnerParams = pigeonVar_list[5] as! FlutterPartnerParams + let antifraud: FlutterAntifraud? = nilOrValue(pigeonVar_list[6]) + let dob: String? = nilOrValue(pigeonVar_list[7]) + let photoBase64: String? = nilOrValue(pigeonVar_list[8]) + let gender: String? = nilOrValue(pigeonVar_list[9]) + let idType: String? = nilOrValue(pigeonVar_list[10]) + let address: String? = nilOrValue(pigeonVar_list[11]) + let country: String? = nilOrValue(pigeonVar_list[12]) + let documentImageBase64: String? = nilOrValue(pigeonVar_list[13]) + let fullData: [String?: String?]? = nilOrValue(pigeonVar_list[14]) + let fullName: String? = nilOrValue(pigeonVar_list[15]) + let idNumber: String? = nilOrValue(pigeonVar_list[16]) + let phoneNumber: String? = nilOrValue(pigeonVar_list[17]) + let phoneNumber2: String? = nilOrValue(pigeonVar_list[18]) + let expirationDate: String? = nilOrValue(pigeonVar_list[19]) + let secondaryIdNumber: String? = nilOrValue(pigeonVar_list[20]) + let idNumberPreviouslyRegistered: Bool? = nilOrValue(pigeonVar_list[21]) + let previousRegistrantsUserIds: [String?]? = nilOrValue(pigeonVar_list[22]) return FlutterEnhancedDocumentVerificationJobResult( actions: actions, @@ -1274,13 +1787,13 @@ struct FlutterEnhancedDocumentVerificationJobResult { } func toList() -> [Any?] { return [ - actions.toList(), + actions, resultCode, resultText, resultType, smileJobId, - partnerParams.toList(), - antifraud?.toList(), + partnerParams, + antifraud, dob, photoBase64, gender, @@ -1312,21 +1825,17 @@ struct FlutterEnhancedDocumentVerificationJobStatusResponse { var history: [FlutterEnhancedDocumentVerificationJobResult?]? = nil var imageLinks: FlutterImageLinks? = nil - static func fromList(_ list: [Any?]) -> FlutterEnhancedDocumentVerificationJobStatusResponse? { - let timestamp = list[0] as! String - let jobComplete = list[1] as! Bool - let jobSuccess = list[2] as! Bool - let code = list[3] as! String - var result: FlutterEnhancedDocumentVerificationJobResult? = nil - if let resultList: [Any?] = nilOrValue(list[4]) { - result = FlutterEnhancedDocumentVerificationJobResult.fromList(resultList) - } - let resultString: String? = nilOrValue(list[5]) - let history: [FlutterEnhancedDocumentVerificationJobResult?]? = nilOrValue(list[6]) - var imageLinks: FlutterImageLinks? = nil - if let imageLinksList: [Any?] = nilOrValue(list[7]) { - imageLinks = FlutterImageLinks.fromList(imageLinksList) - } + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterEnhancedDocumentVerificationJobStatusResponse? { + let timestamp = pigeonVar_list[0] as! String + let jobComplete = pigeonVar_list[1] as! Bool + let jobSuccess = pigeonVar_list[2] as! Bool + let code = pigeonVar_list[3] as! String + let result: FlutterEnhancedDocumentVerificationJobResult? = nilOrValue(pigeonVar_list[4]) + let resultString: String? = nilOrValue(pigeonVar_list[5]) + let history: [FlutterEnhancedDocumentVerificationJobResult?]? = nilOrValue(pigeonVar_list[6]) + let imageLinks: FlutterImageLinks? = nilOrValue(pigeonVar_list[7]) return FlutterEnhancedDocumentVerificationJobStatusResponse( timestamp: timestamp, @@ -1345,10 +1854,10 @@ struct FlutterEnhancedDocumentVerificationJobStatusResponse { jobComplete, jobSuccess, code, - result?.toList(), + result, resultString, history, - imageLinks?.toList(), + imageLinks, ] } } @@ -1359,10 +1868,12 @@ struct FlutterProductsConfigRequest { var timestamp: String var signature: String - static func fromList(_ list: [Any?]) -> FlutterProductsConfigRequest? { - let partnerId = list[0] as! String - let timestamp = list[1] as! String - let signature = list[2] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterProductsConfigRequest? { + let partnerId = pigeonVar_list[0] as! String + let timestamp = pigeonVar_list[1] as! String + let signature = pigeonVar_list[2] as! String return FlutterProductsConfigRequest( partnerId: partnerId, @@ -1384,9 +1895,11 @@ struct FlutterProductsConfigResponse { var consentRequired: [String?: [String?]?] var idSelection: FlutterIdSelection - static func fromList(_ list: [Any?]) -> FlutterProductsConfigResponse? { - let consentRequired = list[0] as! [String?: [String?]?] - let idSelection = FlutterIdSelection.fromList(list[1] as! [Any?])! + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterProductsConfigResponse? { + let consentRequired = pigeonVar_list[0] as! [String?: [String?]?] + let idSelection = pigeonVar_list[1] as! FlutterIdSelection return FlutterProductsConfigResponse( consentRequired: consentRequired, @@ -1396,7 +1909,7 @@ struct FlutterProductsConfigResponse { func toList() -> [Any?] { return [ consentRequired, - idSelection.toList(), + idSelection, ] } } @@ -1408,11 +1921,13 @@ struct FlutterIdSelection { var enhancedKyc: [String?: [String?]?] var documentVerification: [String?: [String?]?] - static func fromList(_ list: [Any?]) -> FlutterIdSelection? { - let basicKyc = list[0] as! [String?: [String?]?] - let biometricKyc = list[1] as! [String?: [String?]?] - let enhancedKyc = list[2] as! [String?: [String?]?] - let documentVerification = list[3] as! [String?: [String?]?] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterIdSelection? { + let basicKyc = pigeonVar_list[0] as! [String?: [String?]?] + let biometricKyc = pigeonVar_list[1] as! [String?: [String?]?] + let enhancedKyc = pigeonVar_list[2] as! [String?: [String?]?] + let documentVerification = pigeonVar_list[3] as! [String?: [String?]?] return FlutterIdSelection( basicKyc: basicKyc, @@ -1435,8 +1950,10 @@ struct FlutterIdSelection { struct FlutterValidDocumentsResponse { var validDocuments: [FlutterValidDocument?] - static func fromList(_ list: [Any?]) -> FlutterValidDocumentsResponse? { - let validDocuments = list[0] as! [FlutterValidDocument?] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterValidDocumentsResponse? { + let validDocuments = pigeonVar_list[0] as! [FlutterValidDocument?] return FlutterValidDocumentsResponse( validDocuments: validDocuments @@ -1454,9 +1971,11 @@ struct FlutterValidDocument { var country: FlutterCountry var idTypes: [FlutterIdType?] - static func fromList(_ list: [Any?]) -> FlutterValidDocument? { - let country = FlutterCountry.fromList(list[0] as! [Any?])! - let idTypes = list[1] as! [FlutterIdType?] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterValidDocument? { + let country = pigeonVar_list[0] as! FlutterCountry + let idTypes = pigeonVar_list[1] as! [FlutterIdType?] return FlutterValidDocument( country: country, @@ -1465,7 +1984,7 @@ struct FlutterValidDocument { } func toList() -> [Any?] { return [ - country.toList(), + country, idTypes, ] } @@ -1477,10 +1996,12 @@ struct FlutterCountry { var continent: String var name: String - static func fromList(_ list: [Any?]) -> FlutterCountry? { - let code = list[0] as! String - let continent = list[1] as! String - let name = list[2] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterCountry? { + let code = pigeonVar_list[0] as! String + let continent = pigeonVar_list[1] as! String + let name = pigeonVar_list[2] as! String return FlutterCountry( code: code, @@ -1504,11 +2025,13 @@ struct FlutterIdType { var hasBack: Bool var name: String - static func fromList(_ list: [Any?]) -> FlutterIdType? { - let code = list[0] as! String - let example = list[1] as! [String?] - let hasBack = list[2] as! Bool - let name = list[3] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterIdType? { + let code = pigeonVar_list[0] as! String + let example = pigeonVar_list[1] as! [String?] + let hasBack = pigeonVar_list[2] as! Bool + let name = pigeonVar_list[3] as! String return FlutterIdType( code: code, @@ -1532,9 +2055,11 @@ struct FlutterServicesResponse { var bankCodes: [FlutterBankCode?] var hostedWeb: FlutterHostedWeb - static func fromList(_ list: [Any?]) -> FlutterServicesResponse? { - let bankCodes = list[0] as! [FlutterBankCode?] - let hostedWeb = FlutterHostedWeb.fromList(list[1] as! [Any?])! + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterServicesResponse? { + let bankCodes = pigeonVar_list[0] as! [FlutterBankCode?] + let hostedWeb = pigeonVar_list[1] as! FlutterHostedWeb return FlutterServicesResponse( bankCodes: bankCodes, @@ -1544,7 +2069,7 @@ struct FlutterServicesResponse { func toList() -> [Any?] { return [ bankCodes, - hostedWeb.toList(), + hostedWeb, ] } } @@ -1554,9 +2079,11 @@ struct FlutterBankCode { var name: String var code: String - static func fromList(_ list: [Any?]) -> FlutterBankCode? { - let name = list[0] as! String - let code = list[1] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterBankCode? { + let name = pigeonVar_list[0] as! String + let code = pigeonVar_list[1] as! String return FlutterBankCode( name: name, @@ -1580,13 +2107,15 @@ struct FlutterHostedWeb { var enhancedKycSmartSelfie: [String?: FlutterCountryInfo?] var enhancedDocumentVerification: [String?: FlutterCountryInfo?] - static func fromList(_ list: [Any?]) -> FlutterHostedWeb? { - let basicKyc = list[0] as! [String?: FlutterCountryInfo?] - let biometricKyc = list[1] as! [String?: FlutterCountryInfo?] - let enhancedKyc = list[2] as! [String?: FlutterCountryInfo?] - let documentVerification = list[3] as! [String?: FlutterCountryInfo?] - let enhancedKycSmartSelfie = list[4] as! [String?: FlutterCountryInfo?] - let enhancedDocumentVerification = list[5] as! [String?: FlutterCountryInfo?] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterHostedWeb? { + let basicKyc = pigeonVar_list[0] as! [String?: FlutterCountryInfo?] + let biometricKyc = pigeonVar_list[1] as! [String?: FlutterCountryInfo?] + let enhancedKyc = pigeonVar_list[2] as! [String?: FlutterCountryInfo?] + let documentVerification = pigeonVar_list[3] as! [String?: FlutterCountryInfo?] + let enhancedKycSmartSelfie = pigeonVar_list[4] as! [String?: FlutterCountryInfo?] + let enhancedDocumentVerification = pigeonVar_list[5] as! [String?: FlutterCountryInfo?] return FlutterHostedWeb( basicKyc: basicKyc, @@ -1615,10 +2144,12 @@ struct FlutterCountryInfo { var name: String var availableIdTypes: [FlutterAvailableIdType?] - static func fromList(_ list: [Any?]) -> FlutterCountryInfo? { - let countryCode = list[0] as! String - let name = list[1] as! String - let availableIdTypes = list[2] as! [FlutterAvailableIdType?] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterCountryInfo? { + let countryCode = pigeonVar_list[0] as! String + let name = pigeonVar_list[1] as! String + let availableIdTypes = pigeonVar_list[2] as! [FlutterAvailableIdType?] return FlutterCountryInfo( countryCode: countryCode, @@ -1643,12 +2174,14 @@ struct FlutterAvailableIdType { var testData: String? = nil var idNumberRegex: String? = nil - static func fromList(_ list: [Any?]) -> FlutterAvailableIdType? { - let idTypeKey = list[0] as! String - let label = list[1] as! String - let requiredFields = list[2] as! [String?] - let testData: String? = nilOrValue(list[3]) - let idNumberRegex: String? = nilOrValue(list[4]) + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterAvailableIdType? { + let idTypeKey = pigeonVar_list[0] as! String + let label = pigeonVar_list[1] as! String + let requiredFields = pigeonVar_list[2] as! [String?] + let testData: String? = nilOrValue(pigeonVar_list[3]) + let idNumberRegex: String? = nilOrValue(pigeonVar_list[4]) return FlutterAvailableIdType( idTypeKey: idTypeKey, @@ -1676,11 +2209,13 @@ struct FlutterConfig { var prodBaseUrl: String var sandboxBaseUrl: String - static func fromList(_ list: [Any?]) -> FlutterConfig? { - let partnerId = list[0] as! String - let authToken = list[1] as! String - let prodBaseUrl = list[2] as! String - let sandboxBaseUrl = list[3] as! String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> FlutterConfig? { + let partnerId = pigeonVar_list[0] as! String + let authToken = pigeonVar_list[1] as! String + let prodBaseUrl = pigeonVar_list[2] as! String + let sandboxBaseUrl = pigeonVar_list[3] as! String return FlutterConfig( partnerId: partnerId, @@ -1699,252 +2234,502 @@ struct FlutterConfig { } } -private class SmileIDApiCodecReader: FlutterStandardReader { +private class SmileIDMessagesPigeonCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return FlutterActions.fromList(self.readValue() as! [Any?]) case 129: - return FlutterAntifraud.fromList(self.readValue() as! [Any?]) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return FlutterJobType(rawValue: enumResultAsInt) + } + return nil case 130: - return FlutterAuthenticationRequest.fromList(self.readValue() as! [Any?]) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return FlutterJobTypeV2(rawValue: enumResultAsInt) + } + return nil case 131: - return FlutterAuthenticationResponse.fromList(self.readValue() as! [Any?]) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return FlutterImageType(rawValue: enumResultAsInt) + } + return nil case 132: - return FlutterAvailableIdType.fromList(self.readValue() as! [Any?]) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return FlutterActionResult(rawValue: enumResultAsInt) + } + return nil case 133: - return FlutterBankCode.fromList(self.readValue() as! [Any?]) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return FlutterSmartSelfieStatus(rawValue: enumResultAsInt) + } + return nil case 134: - return FlutterBiometricKycJobResult.fromList(self.readValue() as! [Any?]) + return FlutterPartnerParams.fromList(self.readValue() as! [Any?]) case 135: - return FlutterBiometricKycJobResult.fromList(self.readValue() as! [Any?]) + return SmartSelfieCreationParams.fromList(self.readValue() as! [Any?]) case 136: - return FlutterBiometricKycJobStatusResponse.fromList(self.readValue() as! [Any?]) + return SmartSelfieEnhancedCreationParams.fromList(self.readValue() as! [Any?]) case 137: - return FlutterConfig.fromList(self.readValue() as! [Any?]) + return SmartSelfieCaptureResult.fromList(self.readValue() as! [Any?]) case 138: - return FlutterConsentInfo.fromList(self.readValue() as! [Any?]) + return DocumentVerificationCreationParams.fromList(self.readValue() as! [Any?]) case 139: - return FlutterCountry.fromList(self.readValue() as! [Any?]) + return DocumentVerificationEnhancedCreationParams.fromList(self.readValue() as! [Any?]) case 140: - return FlutterCountryInfo.fromList(self.readValue() as! [Any?]) + return DocumentCaptureResult.fromList(self.readValue() as! [Any?]) case 141: - return FlutterDocumentVerificationJobResult.fromList(self.readValue() as! [Any?]) + return BiometricKYCCreationParams.fromList(self.readValue() as! [Any?]) case 142: - return FlutterDocumentVerificationJobResult.fromList(self.readValue() as! [Any?]) + return BiometricKYCCaptureResult.fromList(self.readValue() as! [Any?]) case 143: - return FlutterDocumentVerificationJobStatusResponse.fromList(self.readValue() as! [Any?]) + return SelfieCaptureViewCreationParams.fromList(self.readValue() as! [Any?]) case 144: - return FlutterEnhancedDocumentVerificationJobResult.fromList(self.readValue() as! [Any?]) + return DocumentCaptureCreationParams.fromList(self.readValue() as! [Any?]) case 145: - return FlutterEnhancedDocumentVerificationJobResult.fromList(self.readValue() as! [Any?]) + return FlutterAuthenticationRequest.fromList(self.readValue() as! [Any?]) case 146: - return FlutterEnhancedDocumentVerificationJobStatusResponse.fromList(self.readValue() as! [Any?]) + return FlutterAuthenticationResponse.fromList(self.readValue() as! [Any?]) case 147: - return FlutterEnhancedKycAsyncResponse.fromList(self.readValue() as! [Any?]) + return FlutterPrepUploadRequest.fromList(self.readValue() as! [Any?]) case 148: - return FlutterEnhancedKycRequest.fromList(self.readValue() as! [Any?]) + return FlutterPrepUploadResponse.fromList(self.readValue() as! [Any?]) case 149: - return FlutterEnhancedKycResponse.fromList(self.readValue() as! [Any?]) + return FlutterUploadRequest.fromList(self.readValue() as! [Any?]) case 150: - return FlutterHostedWeb.fromList(self.readValue() as! [Any?]) + return FlutterUploadImageInfo.fromList(self.readValue() as! [Any?]) case 151: return FlutterIdInfo.fromList(self.readValue() as! [Any?]) case 152: - return FlutterIdSelection.fromList(self.readValue() as! [Any?]) + return FlutterEnhancedKycResponse.fromList(self.readValue() as! [Any?]) case 153: - return FlutterIdType.fromList(self.readValue() as! [Any?]) + return FlutterActions.fromList(self.readValue() as! [Any?]) case 154: - return FlutterImageLinks.fromList(self.readValue() as! [Any?]) + return FlutterConsentInfo.fromList(self.readValue() as! [Any?]) case 155: - return FlutterJobStatusRequest.fromList(self.readValue() as! [Any?]) + return FlutterEnhancedKycRequest.fromList(self.readValue() as! [Any?]) case 156: - return FlutterPartnerParams.fromList(self.readValue() as! [Any?]) + return FlutterEnhancedKycAsyncResponse.fromList(self.readValue() as! [Any?]) case 157: - return FlutterPrepUploadRequest.fromList(self.readValue() as! [Any?]) + return FlutterImageLinks.fromList(self.readValue() as! [Any?]) case 158: - return FlutterPrepUploadResponse.fromList(self.readValue() as! [Any?]) + return FlutterAntifraud.fromList(self.readValue() as! [Any?]) case 159: - return FlutterProductsConfigRequest.fromList(self.readValue() as! [Any?]) + return FlutterSuspectUser.fromList(self.readValue() as! [Any?]) case 160: - return FlutterProductsConfigResponse.fromList(self.readValue() as! [Any?]) + return FlutterJobStatusRequest.fromList(self.readValue() as! [Any?]) case 161: - return FlutterServicesResponse.fromList(self.readValue() as! [Any?]) - case 162: return FlutterSmartSelfieJobResult.fromList(self.readValue() as! [Any?]) + case 162: + return FlutterSmartSelfieJobStatusResponse.fromList(self.readValue() as! [Any?]) case 163: - return FlutterSmartSelfieJobResult.fromList(self.readValue() as! [Any?]) + return FlutterSmartSelfieResponse.fromList(self.readValue() as! [Any?]) case 164: - return FlutterSmartSelfieJobStatusResponse.fromList(self.readValue() as! [Any?]) + return FlutterDocumentVerificationJobResult.fromList(self.readValue() as! [Any?]) case 165: - return FlutterSmartSelfieResponse.fromList(self.readValue() as! [Any?]) + return FlutterDocumentVerificationJobStatusResponse.fromList(self.readValue() as! [Any?]) case 166: - return FlutterSuspectUser.fromList(self.readValue() as! [Any?]) + return FlutterBiometricKycJobResult.fromList(self.readValue() as! [Any?]) case 167: - return FlutterUploadImageInfo.fromList(self.readValue() as! [Any?]) + return FlutterBiometricKycJobStatusResponse.fromList(self.readValue() as! [Any?]) case 168: - return FlutterUploadRequest.fromList(self.readValue() as! [Any?]) + return FlutterEnhancedDocumentVerificationJobResult.fromList(self.readValue() as! [Any?]) case 169: - return FlutterValidDocument.fromList(self.readValue() as! [Any?]) + return FlutterEnhancedDocumentVerificationJobStatusResponse.fromList(self.readValue() as! [Any?]) case 170: + return FlutterProductsConfigRequest.fromList(self.readValue() as! [Any?]) + case 171: + return FlutterProductsConfigResponse.fromList(self.readValue() as! [Any?]) + case 172: + return FlutterIdSelection.fromList(self.readValue() as! [Any?]) + case 173: return FlutterValidDocumentsResponse.fromList(self.readValue() as! [Any?]) + case 174: + return FlutterValidDocument.fromList(self.readValue() as! [Any?]) + case 175: + return FlutterCountry.fromList(self.readValue() as! [Any?]) + case 176: + return FlutterIdType.fromList(self.readValue() as! [Any?]) + case 177: + return FlutterServicesResponse.fromList(self.readValue() as! [Any?]) + case 178: + return FlutterBankCode.fromList(self.readValue() as! [Any?]) + case 179: + return FlutterHostedWeb.fromList(self.readValue() as! [Any?]) + case 180: + return FlutterCountryInfo.fromList(self.readValue() as! [Any?]) + case 181: + return FlutterAvailableIdType.fromList(self.readValue() as! [Any?]) + case 182: + return FlutterConfig.fromList(self.readValue() as! [Any?]) default: return super.readValue(ofType: type) } } } -private class SmileIDApiCodecWriter: FlutterStandardWriter { +private class SmileIDMessagesPigeonCodecWriter: FlutterStandardWriter { override func writeValue(_ value: Any) { - if let value = value as? FlutterActions { - super.writeByte(128) - super.writeValue(value.toList()) - } else if let value = value as? FlutterAntifraud { + if let value = value as? FlutterJobType { super.writeByte(129) - super.writeValue(value.toList()) - } else if let value = value as? FlutterAuthenticationRequest { + super.writeValue(value.rawValue) + } else if let value = value as? FlutterJobTypeV2 { super.writeByte(130) - super.writeValue(value.toList()) - } else if let value = value as? FlutterAuthenticationResponse { + super.writeValue(value.rawValue) + } else if let value = value as? FlutterImageType { super.writeByte(131) - super.writeValue(value.toList()) - } else if let value = value as? FlutterAvailableIdType { + super.writeValue(value.rawValue) + } else if let value = value as? FlutterActionResult { super.writeByte(132) - super.writeValue(value.toList()) - } else if let value = value as? FlutterBankCode { + super.writeValue(value.rawValue) + } else if let value = value as? FlutterSmartSelfieStatus { super.writeByte(133) - super.writeValue(value.toList()) - } else if let value = value as? FlutterBiometricKycJobResult { + super.writeValue(value.rawValue) + } else if let value = value as? FlutterPartnerParams { super.writeByte(134) super.writeValue(value.toList()) - } else if let value = value as? FlutterBiometricKycJobResult { + } else if let value = value as? SmartSelfieCreationParams { super.writeByte(135) super.writeValue(value.toList()) - } else if let value = value as? FlutterBiometricKycJobStatusResponse { + } else if let value = value as? SmartSelfieEnhancedCreationParams { super.writeByte(136) super.writeValue(value.toList()) - } else if let value = value as? FlutterConfig { + } else if let value = value as? SmartSelfieCaptureResult { super.writeByte(137) super.writeValue(value.toList()) - } else if let value = value as? FlutterConsentInfo { + } else if let value = value as? DocumentVerificationCreationParams { super.writeByte(138) super.writeValue(value.toList()) - } else if let value = value as? FlutterCountry { + } else if let value = value as? DocumentVerificationEnhancedCreationParams { super.writeByte(139) super.writeValue(value.toList()) - } else if let value = value as? FlutterCountryInfo { + } else if let value = value as? DocumentCaptureResult { super.writeByte(140) super.writeValue(value.toList()) - } else if let value = value as? FlutterDocumentVerificationJobResult { + } else if let value = value as? BiometricKYCCreationParams { super.writeByte(141) super.writeValue(value.toList()) - } else if let value = value as? FlutterDocumentVerificationJobResult { + } else if let value = value as? BiometricKYCCaptureResult { super.writeByte(142) super.writeValue(value.toList()) - } else if let value = value as? FlutterDocumentVerificationJobStatusResponse { + } else if let value = value as? SelfieCaptureViewCreationParams { super.writeByte(143) super.writeValue(value.toList()) - } else if let value = value as? FlutterEnhancedDocumentVerificationJobResult { + } else if let value = value as? DocumentCaptureCreationParams { super.writeByte(144) super.writeValue(value.toList()) - } else if let value = value as? FlutterEnhancedDocumentVerificationJobResult { + } else if let value = value as? FlutterAuthenticationRequest { super.writeByte(145) super.writeValue(value.toList()) - } else if let value = value as? FlutterEnhancedDocumentVerificationJobStatusResponse { + } else if let value = value as? FlutterAuthenticationResponse { super.writeByte(146) super.writeValue(value.toList()) - } else if let value = value as? FlutterEnhancedKycAsyncResponse { + } else if let value = value as? FlutterPrepUploadRequest { super.writeByte(147) super.writeValue(value.toList()) - } else if let value = value as? FlutterEnhancedKycRequest { + } else if let value = value as? FlutterPrepUploadResponse { super.writeByte(148) super.writeValue(value.toList()) - } else if let value = value as? FlutterEnhancedKycResponse { + } else if let value = value as? FlutterUploadRequest { super.writeByte(149) super.writeValue(value.toList()) - } else if let value = value as? FlutterHostedWeb { + } else if let value = value as? FlutterUploadImageInfo { super.writeByte(150) super.writeValue(value.toList()) } else if let value = value as? FlutterIdInfo { super.writeByte(151) super.writeValue(value.toList()) - } else if let value = value as? FlutterIdSelection { + } else if let value = value as? FlutterEnhancedKycResponse { super.writeByte(152) super.writeValue(value.toList()) - } else if let value = value as? FlutterIdType { + } else if let value = value as? FlutterActions { super.writeByte(153) super.writeValue(value.toList()) - } else if let value = value as? FlutterImageLinks { + } else if let value = value as? FlutterConsentInfo { super.writeByte(154) super.writeValue(value.toList()) - } else if let value = value as? FlutterJobStatusRequest { + } else if let value = value as? FlutterEnhancedKycRequest { super.writeByte(155) super.writeValue(value.toList()) - } else if let value = value as? FlutterPartnerParams { + } else if let value = value as? FlutterEnhancedKycAsyncResponse { super.writeByte(156) super.writeValue(value.toList()) - } else if let value = value as? FlutterPrepUploadRequest { + } else if let value = value as? FlutterImageLinks { super.writeByte(157) super.writeValue(value.toList()) - } else if let value = value as? FlutterPrepUploadResponse { + } else if let value = value as? FlutterAntifraud { super.writeByte(158) super.writeValue(value.toList()) - } else if let value = value as? FlutterProductsConfigRequest { + } else if let value = value as? FlutterSuspectUser { super.writeByte(159) super.writeValue(value.toList()) - } else if let value = value as? FlutterProductsConfigResponse { + } else if let value = value as? FlutterJobStatusRequest { super.writeByte(160) super.writeValue(value.toList()) - } else if let value = value as? FlutterServicesResponse { + } else if let value = value as? FlutterSmartSelfieJobResult { super.writeByte(161) super.writeValue(value.toList()) - } else if let value = value as? FlutterSmartSelfieJobResult { + } else if let value = value as? FlutterSmartSelfieJobStatusResponse { super.writeByte(162) super.writeValue(value.toList()) - } else if let value = value as? FlutterSmartSelfieJobResult { + } else if let value = value as? FlutterSmartSelfieResponse { super.writeByte(163) super.writeValue(value.toList()) - } else if let value = value as? FlutterSmartSelfieJobStatusResponse { + } else if let value = value as? FlutterDocumentVerificationJobResult { super.writeByte(164) super.writeValue(value.toList()) - } else if let value = value as? FlutterSmartSelfieResponse { + } else if let value = value as? FlutterDocumentVerificationJobStatusResponse { super.writeByte(165) super.writeValue(value.toList()) - } else if let value = value as? FlutterSuspectUser { + } else if let value = value as? FlutterBiometricKycJobResult { super.writeByte(166) super.writeValue(value.toList()) - } else if let value = value as? FlutterUploadImageInfo { + } else if let value = value as? FlutterBiometricKycJobStatusResponse { super.writeByte(167) super.writeValue(value.toList()) - } else if let value = value as? FlutterUploadRequest { + } else if let value = value as? FlutterEnhancedDocumentVerificationJobResult { super.writeByte(168) super.writeValue(value.toList()) - } else if let value = value as? FlutterValidDocument { + } else if let value = value as? FlutterEnhancedDocumentVerificationJobStatusResponse { super.writeByte(169) super.writeValue(value.toList()) - } else if let value = value as? FlutterValidDocumentsResponse { + } else if let value = value as? FlutterProductsConfigRequest { super.writeByte(170) super.writeValue(value.toList()) + } else if let value = value as? FlutterProductsConfigResponse { + super.writeByte(171) + super.writeValue(value.toList()) + } else if let value = value as? FlutterIdSelection { + super.writeByte(172) + super.writeValue(value.toList()) + } else if let value = value as? FlutterValidDocumentsResponse { + super.writeByte(173) + super.writeValue(value.toList()) + } else if let value = value as? FlutterValidDocument { + super.writeByte(174) + super.writeValue(value.toList()) + } else if let value = value as? FlutterCountry { + super.writeByte(175) + super.writeValue(value.toList()) + } else if let value = value as? FlutterIdType { + super.writeByte(176) + super.writeValue(value.toList()) + } else if let value = value as? FlutterServicesResponse { + super.writeByte(177) + super.writeValue(value.toList()) + } else if let value = value as? FlutterBankCode { + super.writeByte(178) + super.writeValue(value.toList()) + } else if let value = value as? FlutterHostedWeb { + super.writeByte(179) + super.writeValue(value.toList()) + } else if let value = value as? FlutterCountryInfo { + super.writeByte(180) + super.writeValue(value.toList()) + } else if let value = value as? FlutterAvailableIdType { + super.writeByte(181) + super.writeValue(value.toList()) + } else if let value = value as? FlutterConfig { + super.writeByte(182) + super.writeValue(value.toList()) } else { super.writeValue(value) } } } -private class SmileIDApiCodecReaderWriter: FlutterStandardReaderWriter { +private class SmileIDMessagesPigeonCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - return SmileIDApiCodecReader(data: data) + return SmileIDMessagesPigeonCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return SmileIDApiCodecWriter(data: data) + return SmileIDMessagesPigeonCodecWriter(data: data) } } -class SmileIDApiCodec: FlutterStandardMessageCodec { - static let shared = SmileIDApiCodec(readerWriter: SmileIDApiCodecReaderWriter()) +class SmileIDMessagesPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = SmileIDMessagesPigeonCodec(readerWriter: SmileIDMessagesPigeonCodecReaderWriter()) } + +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol SmileIDProductsApi { + func documentVerification(creationParams: DocumentVerificationCreationParams, completion: @escaping (Result) -> Void) + func documentVerificationEnhanced(creationParams: DocumentVerificationEnhancedCreationParams, completion: @escaping (Result) -> Void) + func smartSelfieEnrollment(creationParams: SmartSelfieCreationParams, completion: @escaping (Result) -> Void) + func smartSelfieAuthentication(creationParams: SmartSelfieCreationParams, completion: @escaping (Result) -> Void) + func smartSelfieEnrollmentEnhanced(creationParams: SmartSelfieEnhancedCreationParams, completion: @escaping (Result) -> Void) + func smartSelfieAuthenticationEnhanced(creationParams: SmartSelfieEnhancedCreationParams, completion: @escaping (Result) -> Void) + func biometricKYC(creationParams: BiometricKYCCreationParams, completion: @escaping (Result) -> Void) + func selfieCapture(creationParams: SelfieCaptureViewCreationParams, completion: @escaping (Result) -> Void) + func documentCapture(creationParams: DocumentCaptureCreationParams, completion: @escaping (Result) -> Void) +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class SmileIDProductsApiSetup { + static var codec: FlutterStandardMessageCodec { SmileIDMessagesPigeonCodec.shared } + /// Sets up an instance of `SmileIDProductsApi` to handle messages through the `binaryMessenger`. + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: SmileIDProductsApi?, messageChannelSuffix: String = "") { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let documentVerificationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDProductsApi.documentVerification\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + documentVerificationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let creationParamsArg = args[0] as! DocumentVerificationCreationParams + api.documentVerification(creationParams: creationParamsArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + documentVerificationChannel.setMessageHandler(nil) + } + let documentVerificationEnhancedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDProductsApi.documentVerificationEnhanced\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + documentVerificationEnhancedChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let creationParamsArg = args[0] as! DocumentVerificationEnhancedCreationParams + api.documentVerificationEnhanced(creationParams: creationParamsArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + documentVerificationEnhancedChannel.setMessageHandler(nil) + } + let smartSelfieEnrollmentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieEnrollment\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + smartSelfieEnrollmentChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let creationParamsArg = args[0] as! SmartSelfieCreationParams + api.smartSelfieEnrollment(creationParams: creationParamsArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + smartSelfieEnrollmentChannel.setMessageHandler(nil) + } + let smartSelfieAuthenticationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieAuthentication\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + smartSelfieAuthenticationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let creationParamsArg = args[0] as! SmartSelfieCreationParams + api.smartSelfieAuthentication(creationParams: creationParamsArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + smartSelfieAuthenticationChannel.setMessageHandler(nil) + } + let smartSelfieEnrollmentEnhancedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieEnrollmentEnhanced\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + smartSelfieEnrollmentEnhancedChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let creationParamsArg = args[0] as! SmartSelfieEnhancedCreationParams + api.smartSelfieEnrollmentEnhanced(creationParams: creationParamsArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + smartSelfieEnrollmentEnhancedChannel.setMessageHandler(nil) + } + let smartSelfieAuthenticationEnhancedChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieAuthenticationEnhanced\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + smartSelfieAuthenticationEnhancedChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let creationParamsArg = args[0] as! SmartSelfieEnhancedCreationParams + api.smartSelfieAuthenticationEnhanced(creationParams: creationParamsArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + smartSelfieAuthenticationEnhancedChannel.setMessageHandler(nil) + } + let biometricKYCChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDProductsApi.biometricKYC\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + biometricKYCChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let creationParamsArg = args[0] as! BiometricKYCCreationParams + api.biometricKYC(creationParams: creationParamsArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + biometricKYCChannel.setMessageHandler(nil) + } + let selfieCaptureChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDProductsApi.selfieCapture\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + selfieCaptureChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let creationParamsArg = args[0] as! SelfieCaptureViewCreationParams + api.selfieCapture(creationParams: creationParamsArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + selfieCaptureChannel.setMessageHandler(nil) + } + let documentCaptureChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDProductsApi.documentCapture\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + documentCaptureChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let creationParamsArg = args[0] as! DocumentCaptureCreationParams + api.documentCapture(creationParams: creationParamsArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + documentCaptureChannel.setMessageHandler(nil) + } + } +} /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol SmileIDApi { func initializeWithApiKey(apiKey: String, config: FlutterConfig, useSandbox: Bool, enableCrashReporting: Bool) throws @@ -1979,11 +2764,11 @@ protocol SmileIDApi { /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class SmileIDApiSetup { - /// The codec used by SmileIDApi. - static var codec: FlutterStandardMessageCodec { SmileIDApiCodec.shared } + static var codec: FlutterStandardMessageCodec { SmileIDMessagesPigeonCodec.shared } /// Sets up an instance of `SmileIDApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: SmileIDApi?) { - let initializeWithApiKeyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.initializeWithApiKey", binaryMessenger: binaryMessenger, codec: codec) + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: SmileIDApi?, messageChannelSuffix: String = "") { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let initializeWithApiKeyChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.initializeWithApiKey\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { initializeWithApiKeyChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2001,7 +2786,7 @@ class SmileIDApiSetup { } else { initializeWithApiKeyChannel.setMessageHandler(nil) } - let initializeWithConfigChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.initializeWithConfig", binaryMessenger: binaryMessenger, codec: codec) + let initializeWithConfigChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.initializeWithConfig\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { initializeWithConfigChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2018,7 +2803,7 @@ class SmileIDApiSetup { } else { initializeWithConfigChannel.setMessageHandler(nil) } - let initializeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.initialize", binaryMessenger: binaryMessenger, codec: codec) + let initializeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.initialize\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { initializeChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2033,7 +2818,7 @@ class SmileIDApiSetup { } else { initializeChannel.setMessageHandler(nil) } - let setCallbackUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.setCallbackUrl", binaryMessenger: binaryMessenger, codec: codec) + let setCallbackUrlChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.setCallbackUrl\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setCallbackUrlChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2048,7 +2833,7 @@ class SmileIDApiSetup { } else { setCallbackUrlChannel.setMessageHandler(nil) } - let setAllowOfflineModeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.setAllowOfflineMode", binaryMessenger: binaryMessenger, codec: codec) + let setAllowOfflineModeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.setAllowOfflineMode\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setAllowOfflineModeChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2063,7 +2848,7 @@ class SmileIDApiSetup { } else { setAllowOfflineModeChannel.setMessageHandler(nil) } - let getSubmittedJobsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getSubmittedJobs", binaryMessenger: binaryMessenger, codec: codec) + let getSubmittedJobsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getSubmittedJobs\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getSubmittedJobsChannel.setMessageHandler { _, reply in do { @@ -2076,7 +2861,7 @@ class SmileIDApiSetup { } else { getSubmittedJobsChannel.setMessageHandler(nil) } - let getUnsubmittedJobsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getUnsubmittedJobs", binaryMessenger: binaryMessenger, codec: codec) + let getUnsubmittedJobsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getUnsubmittedJobs\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getUnsubmittedJobsChannel.setMessageHandler { _, reply in do { @@ -2089,7 +2874,7 @@ class SmileIDApiSetup { } else { getUnsubmittedJobsChannel.setMessageHandler(nil) } - let cleanupChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.cleanup", binaryMessenger: binaryMessenger, codec: codec) + let cleanupChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.cleanup\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { cleanupChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2104,7 +2889,7 @@ class SmileIDApiSetup { } else { cleanupChannel.setMessageHandler(nil) } - let cleanupJobsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.cleanupJobs", binaryMessenger: binaryMessenger, codec: codec) + let cleanupJobsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.cleanupJobs\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { cleanupJobsChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2119,7 +2904,7 @@ class SmileIDApiSetup { } else { cleanupJobsChannel.setMessageHandler(nil) } - let submitJobChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.submitJob", binaryMessenger: binaryMessenger, codec: codec) + let submitJobChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.submitJob\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { submitJobChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2135,7 +2920,7 @@ class SmileIDApiSetup { } else { submitJobChannel.setMessageHandler(nil) } - let authenticateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.authenticate", binaryMessenger: binaryMessenger, codec: codec) + let authenticateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.authenticate\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { authenticateChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2152,7 +2937,7 @@ class SmileIDApiSetup { } else { authenticateChannel.setMessageHandler(nil) } - let prepUploadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.prepUpload", binaryMessenger: binaryMessenger, codec: codec) + let prepUploadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.prepUpload\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { prepUploadChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2169,7 +2954,7 @@ class SmileIDApiSetup { } else { prepUploadChannel.setMessageHandler(nil) } - let uploadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.upload", binaryMessenger: binaryMessenger, codec: codec) + let uploadChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.upload\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { uploadChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2187,7 +2972,7 @@ class SmileIDApiSetup { } else { uploadChannel.setMessageHandler(nil) } - let doEnhancedKycChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKyc", binaryMessenger: binaryMessenger, codec: codec) + let doEnhancedKycChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKyc\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { doEnhancedKycChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2204,7 +2989,7 @@ class SmileIDApiSetup { } else { doEnhancedKycChannel.setMessageHandler(nil) } - let doEnhancedKycAsyncChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKycAsync", binaryMessenger: binaryMessenger, codec: codec) + let doEnhancedKycAsyncChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKycAsync\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { doEnhancedKycAsyncChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2221,7 +3006,7 @@ class SmileIDApiSetup { } else { doEnhancedKycAsyncChannel.setMessageHandler(nil) } - let getSmartSelfieJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getSmartSelfieJobStatus", binaryMessenger: binaryMessenger, codec: codec) + let getSmartSelfieJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getSmartSelfieJobStatus\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getSmartSelfieJobStatusChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2238,7 +3023,7 @@ class SmileIDApiSetup { } else { getSmartSelfieJobStatusChannel.setMessageHandler(nil) } - let doSmartSelfieEnrollmentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieEnrollment", binaryMessenger: binaryMessenger, codec: codec) + let doSmartSelfieEnrollmentChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieEnrollment\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { doSmartSelfieEnrollmentChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2249,7 +3034,7 @@ class SmileIDApiSetup { let userIdArg = args[4] as! String let partnerParamsArg: [String?: String?]? = nilOrValue(args[5]) let callbackUrlArg: String? = nilOrValue(args[6]) - let sandboxResultArg: Int64? = isNullish(args[7]) ? nil : (args[7] is Int64? ? args[7] as! Int64? : Int64(args[7] as! Int32)) + let sandboxResultArg: Int64? = nilOrValue(args[7]) let allowNewEnrollArg: Bool? = nilOrValue(args[8]) api.doSmartSelfieEnrollment(signature: signatureArg, timestamp: timestampArg, selfieImage: selfieImageArg, livenessImages: livenessImagesArg, userId: userIdArg, partnerParams: partnerParamsArg, callbackUrl: callbackUrlArg, sandboxResult: sandboxResultArg, allowNewEnroll: allowNewEnrollArg) { result in switch result { @@ -2263,7 +3048,7 @@ class SmileIDApiSetup { } else { doSmartSelfieEnrollmentChannel.setMessageHandler(nil) } - let doSmartSelfieAuthenticationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieAuthentication", binaryMessenger: binaryMessenger, codec: codec) + let doSmartSelfieAuthenticationChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieAuthentication\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { doSmartSelfieAuthenticationChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2274,7 +3059,7 @@ class SmileIDApiSetup { let userIdArg = args[4] as! String let partnerParamsArg: [String?: String?]? = nilOrValue(args[5]) let callbackUrlArg: String? = nilOrValue(args[6]) - let sandboxResultArg: Int64? = isNullish(args[7]) ? nil : (args[7] is Int64? ? args[7] as! Int64? : Int64(args[7] as! Int32)) + let sandboxResultArg: Int64? = nilOrValue(args[7]) api.doSmartSelfieAuthentication(signature: signatureArg, timestamp: timestampArg, selfieImage: selfieImageArg, livenessImages: livenessImagesArg, userId: userIdArg, partnerParams: partnerParamsArg, callbackUrl: callbackUrlArg, sandboxResult: sandboxResultArg) { result in switch result { case .success(let res): @@ -2287,7 +3072,7 @@ class SmileIDApiSetup { } else { doSmartSelfieAuthenticationChannel.setMessageHandler(nil) } - let getDocumentVerificationJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getDocumentVerificationJobStatus", binaryMessenger: binaryMessenger, codec: codec) + let getDocumentVerificationJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getDocumentVerificationJobStatus\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getDocumentVerificationJobStatusChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2304,7 +3089,7 @@ class SmileIDApiSetup { } else { getDocumentVerificationJobStatusChannel.setMessageHandler(nil) } - let getBiometricKycJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getBiometricKycJobStatus", binaryMessenger: binaryMessenger, codec: codec) + let getBiometricKycJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getBiometricKycJobStatus\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getBiometricKycJobStatusChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2321,7 +3106,7 @@ class SmileIDApiSetup { } else { getBiometricKycJobStatusChannel.setMessageHandler(nil) } - let getEnhancedDocumentVerificationJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getEnhancedDocumentVerificationJobStatus", binaryMessenger: binaryMessenger, codec: codec) + let getEnhancedDocumentVerificationJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getEnhancedDocumentVerificationJobStatus\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getEnhancedDocumentVerificationJobStatusChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2338,7 +3123,7 @@ class SmileIDApiSetup { } else { getEnhancedDocumentVerificationJobStatusChannel.setMessageHandler(nil) } - let getProductsConfigChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getProductsConfig", binaryMessenger: binaryMessenger, codec: codec) + let getProductsConfigChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getProductsConfig\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getProductsConfigChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2355,7 +3140,7 @@ class SmileIDApiSetup { } else { getProductsConfigChannel.setMessageHandler(nil) } - let getValidDocumentsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getValidDocuments", binaryMessenger: binaryMessenger, codec: codec) + let getValidDocumentsChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getValidDocuments\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getValidDocumentsChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2372,7 +3157,7 @@ class SmileIDApiSetup { } else { getValidDocumentsChannel.setMessageHandler(nil) } - let getServicesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getServices", binaryMessenger: binaryMessenger, codec: codec) + let getServicesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.getServices\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getServicesChannel.setMessageHandler { _, reply in api.getServices { result in @@ -2387,13 +3172,13 @@ class SmileIDApiSetup { } else { getServicesChannel.setMessageHandler(nil) } - let pollSmartSelfieJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.pollSmartSelfieJobStatus", binaryMessenger: binaryMessenger, codec: codec) + let pollSmartSelfieJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.pollSmartSelfieJobStatus\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pollSmartSelfieJobStatusChannel.setMessageHandler { message, reply in let args = message as! [Any?] let requestArg = args[0] as! FlutterJobStatusRequest - let intervalArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) - let numAttemptsArg = args[2] is Int64 ? args[2] as! Int64 : Int64(args[2] as! Int32) + let intervalArg = args[1] as! Int64 + let numAttemptsArg = args[2] as! Int64 api.pollSmartSelfieJobStatus(request: requestArg, interval: intervalArg, numAttempts: numAttemptsArg) { result in switch result { case .success(let res): @@ -2406,13 +3191,13 @@ class SmileIDApiSetup { } else { pollSmartSelfieJobStatusChannel.setMessageHandler(nil) } - let pollDocumentVerificationJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.pollDocumentVerificationJobStatus", binaryMessenger: binaryMessenger, codec: codec) + let pollDocumentVerificationJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.pollDocumentVerificationJobStatus\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pollDocumentVerificationJobStatusChannel.setMessageHandler { message, reply in let args = message as! [Any?] let requestArg = args[0] as! FlutterJobStatusRequest - let intervalArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) - let numAttemptsArg = args[2] is Int64 ? args[2] as! Int64 : Int64(args[2] as! Int32) + let intervalArg = args[1] as! Int64 + let numAttemptsArg = args[2] as! Int64 api.pollDocumentVerificationJobStatus(request: requestArg, interval: intervalArg, numAttempts: numAttemptsArg) { result in switch result { case .success(let res): @@ -2425,13 +3210,13 @@ class SmileIDApiSetup { } else { pollDocumentVerificationJobStatusChannel.setMessageHandler(nil) } - let pollBiometricKycJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.pollBiometricKycJobStatus", binaryMessenger: binaryMessenger, codec: codec) + let pollBiometricKycJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.pollBiometricKycJobStatus\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pollBiometricKycJobStatusChannel.setMessageHandler { message, reply in let args = message as! [Any?] let requestArg = args[0] as! FlutterJobStatusRequest - let intervalArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) - let numAttemptsArg = args[2] is Int64 ? args[2] as! Int64 : Int64(args[2] as! Int32) + let intervalArg = args[1] as! Int64 + let numAttemptsArg = args[2] as! Int64 api.pollBiometricKycJobStatus(request: requestArg, interval: intervalArg, numAttempts: numAttemptsArg) { result in switch result { case .success(let res): @@ -2444,13 +3229,13 @@ class SmileIDApiSetup { } else { pollBiometricKycJobStatusChannel.setMessageHandler(nil) } - let pollEnhancedDocumentVerificationJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.pollEnhancedDocumentVerificationJobStatus", binaryMessenger: binaryMessenger, codec: codec) + let pollEnhancedDocumentVerificationJobStatusChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.smileid.SmileIDApi.pollEnhancedDocumentVerificationJobStatus\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { pollEnhancedDocumentVerificationJobStatusChannel.setMessageHandler { message, reply in let args = message as! [Any?] let requestArg = args[0] as! FlutterJobStatusRequest - let intervalArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) - let numAttemptsArg = args[2] is Int64 ? args[2] as! Int64 : Int64(args[2] as! Int32) + let intervalArg = args[1] as! Int64 + let numAttemptsArg = args[2] as! Int64 api.pollEnhancedDocumentVerificationJobStatus(request: requestArg, interval: intervalArg, numAttempts: numAttemptsArg) { result in switch result { case .success(let res): diff --git a/ios/Classes/SmileIDPlugin.swift b/ios/Classes/SmileIDPlugin.swift index d8e9844b..b3b76232 100644 --- a/ios/Classes/SmileIDPlugin.swift +++ b/ios/Classes/SmileIDPlugin.swift @@ -1,12 +1,15 @@ import Flutter +import SwiftUI import SmileID import UIKit public class SmileIDPlugin: NSObject, FlutterPlugin, SmileIDApi { + public static func register(with registrar: FlutterPluginRegistrar) { let messenger: FlutterBinaryMessenger = registrar.messenger() let api: SmileIDApi & NSObjectProtocol = SmileIDPlugin() SmileIDApiSetup.setUp(binaryMessenger: messenger, api: api) + SmileIDProductsPluginApi.setUp(binaryMessenger: messenger) let documentVerificationFactory = SmileIDDocumentVerification.Factory( messenger: registrar.messenger() @@ -39,22 +42,22 @@ public class SmileIDPlugin: NSObject, FlutterPlugin, SmileIDApi { smartSelfieAuthenticationFactory, withId: SmileIDSmartSelfieAuthentication.VIEW_TYPE_ID ) - - let smartSelfieEnrollmentEnhancedFactory = SmileIDSmartSelfieEnrollmentEnhanced.Factory( - messenger: registrar.messenger() - ) - registrar.register( - smartSelfieEnrollmentEnhancedFactory, - withId: SmileIDSmartSelfieEnrollmentEnhanced.VIEW_TYPE_ID - ) - - let smartSelfieAuthenticationEnhancedFactory = SmileIDSmartSelfieAuthenticationEnhanced.Factory( - messenger: registrar.messenger() - ) - registrar.register( - smartSelfieAuthenticationEnhancedFactory, - withId: SmileIDSmartSelfieAuthenticationEnhanced.VIEW_TYPE_ID - ) + + let smartSelfieEnrollmentEnhancedFactory = SmileIDSmartSelfieEnrollmentEnhanced.Factory( + messenger: registrar.messenger() + ) + registrar.register( + smartSelfieEnrollmentEnhancedFactory, + withId: SmileIDSmartSelfieEnrollmentEnhanced.VIEW_TYPE_ID + ) + + let smartSelfieAuthenticationEnhancedFactory = SmileIDSmartSelfieAuthenticationEnhanced.Factory( + messenger: registrar.messenger() + ) + registrar.register( + smartSelfieAuthenticationEnhancedFactory, + withId: SmileIDSmartSelfieAuthenticationEnhanced.VIEW_TYPE_ID + ) let biometricKYCFactory = SmileIDBiometricKYC.Factory( messenger: registrar.messenger() diff --git a/ios/Classes/SmileIDProductsPluginApi.swift b/ios/Classes/SmileIDProductsPluginApi.swift new file mode 100644 index 00000000..a4394e0d --- /dev/null +++ b/ios/Classes/SmileIDProductsPluginApi.swift @@ -0,0 +1,151 @@ +import Foundation +import SwiftUI +import Flutter + +public class SmileIDProductsPluginApi: SmileIDProductsApi { + + var navigationController: UINavigationController? = nil + + public static func setUp(binaryMessenger: FlutterBinaryMessenger) { + let api = SmileIDProductsPluginApi() + SmileIDProductsApiSetup.setUp(binaryMessenger: binaryMessenger, api: api) + + let window = UIApplication.shared.delegate?.window + if let controller = window??.rootViewController as? + UIViewController { + let navigationController = UINavigationController(rootViewController: controller) + + navigationController.isNavigationBarHidden = true + window??.rootViewController = navigationController + window??.makeKeyAndVisible() + + api.navigationController = navigationController + return + } + + if let controller = window??.rootViewController as? UINavigationController { + api.navigationController = controller + return + } + + } + + func smartSelfieEnrollment(creationParams: SmartSelfieCreationParams, completion: @escaping (Result) -> Void) { + + if let controller = navigationController { + let smileIdSelfieEnrollmentViewController = UIHostingController(rootView: SmileIDSmartSelfieEnrollmentView(creationParams: creationParams, completion: completion, uiViewController: controller)) + smileIdSelfieEnrollmentViewController.overrideUserInterfaceStyle = .light + + controller.pushViewController(smileIdSelfieEnrollmentViewController, animated: true) + return + } + + completion(.failure(PigeonError(code: "12", message: "Failed to start smart selfie enrollment", details: nil))) + } + + func smartSelfieAuthentication(creationParams: SmartSelfieCreationParams, completion: @escaping (Result) -> Void) { + + if let controller = navigationController { + let smileIdSelfieAuthenticationController = UIHostingController(rootView: SmileIDSmartSelfieAuthenticationView(creationParams: creationParams, completion: completion, uiViewController: controller)) + smileIdSelfieAuthenticationController.overrideUserInterfaceStyle = .light + + controller.pushViewController(smileIdSelfieAuthenticationController, animated: true) + return + } + + completion(.failure(PigeonError(code: "13", message: "Failed to start smart selfie authentication", details: nil))) + } + + func smartSelfieEnrollmentEnhanced(creationParams: SmartSelfieEnhancedCreationParams, completion: @escaping (Result) -> Void) { + + if let controller = navigationController { + let smileIdSelfieEnrollmentEnhancedController = UIHostingController(rootView: SmileIDSmartSelfieEnrollmentEnhancedView(creationParams: creationParams, completion: completion, uiViewController: controller)) + smileIdSelfieEnrollmentEnhancedController.overrideUserInterfaceStyle = .light + + controller.pushViewController(smileIdSelfieEnrollmentEnhancedController, animated: true) + return + } + + completion(.failure(PigeonError(code: "14", message: "Failed to start smart selfie enrollment enhanced", details: nil))) + } + + func smartSelfieAuthenticationEnhanced(creationParams: SmartSelfieEnhancedCreationParams, completion: @escaping (Result) -> Void) { + + if let controller = navigationController { + let smileIDSelfieAuthenticationEnhancedController = UIHostingController( + rootView: SmileIDSmartSelfieAuthenticationEnhancedView(creationParams: creationParams, completion: completion, uiViewController: controller)) + smileIDSelfieAuthenticationEnhancedController.overrideUserInterfaceStyle = .light + + controller.pushViewController(smileIDSelfieAuthenticationEnhancedController, animated: true) + return + } + + completion(.failure(PigeonError(code: "15", message: "Failed to start smart selfie authentication enhance", details: nil))) + } + + func biometricKYC(creationParams: BiometricKYCCreationParams, completion: @escaping (Result) -> Void) { + if let controller = navigationController { + let smileIDBiometricKYCController = UIHostingController( + rootView: SmileIDBiometricKYCView(creationParams: creationParams, completion: completion, uiViewController: controller)) + smileIDBiometricKYCController.overrideUserInterfaceStyle = .light + + controller.pushViewController(smileIDBiometricKYCController, animated: true) + return + } + + completion(.failure(PigeonError(code: "16", message: "Failed to start biometric kyc", details: nil))) + } + + func documentVerification(creationParams: DocumentVerificationCreationParams, completion: @escaping (Result) -> Void) { + if let controller = navigationController { + let smileIDDocumentVerificationController = UIHostingController( + rootView: SmileIDDocumentVerificationView(creationParams: creationParams, completion: completion, uiViewController: controller)) + smileIDDocumentVerificationController.overrideUserInterfaceStyle = .light + + controller.pushViewController(smileIDDocumentVerificationController, animated: true) + return + } + + completion(.failure(PigeonError(code: "17", message: "Failed to start document verification", details: nil))) + } + + func documentVerificationEnhanced(creationParams: DocumentVerificationEnhancedCreationParams, completion: @escaping (Result) -> Void) { + if let controller = navigationController { + let smileIDEnhancedDocumentVerificationController = UIHostingController( + rootView: SmileIDEnhancedDocumentVerificationView(creationParams: creationParams, completion: completion, uiViewController: controller)) + smileIDEnhancedDocumentVerificationController.overrideUserInterfaceStyle = .light + + controller.pushViewController(smileIDEnhancedDocumentVerificationController, animated: true) + return + } + + completion(.failure(PigeonError(code: "18", message: "Failed to start enhanced document verification", details: nil))) + } + + + func selfieCapture(creationParams: SelfieCaptureViewCreationParams, completion: @escaping (Result) -> Void) { + if let controller = navigationController { + let smileSelfieCaptureController = UIHostingController( + rootView: SmileSelfieCaptureView(creationParams: creationParams, completion: completion, uiViewController: controller)) + smileSelfieCaptureController.overrideUserInterfaceStyle = .light + + controller.pushViewController(smileSelfieCaptureController, animated: true) + return + } + + completion(.failure(PigeonError(code: "19", message: "Failed to start selfie capture", details: nil))) + } + + func documentCapture(creationParams: DocumentCaptureCreationParams, completion: @escaping (Result) -> Void) { + if let controller = navigationController { + let smileDocumentCaptureController = UIHostingController( + rootView: SmileDocumentCaptureView(creationParams: creationParams, completion: completion, uiViewController: controller)) + smileDocumentCaptureController.overrideUserInterfaceStyle = .light + + controller.pushViewController(smileDocumentCaptureController, animated: true) + return + } + + completion(.failure(PigeonError(code: "20", message: "Failed to start document capture", details: nil))) + } +} diff --git a/ios/Classes/SmileIDSmartSelfieAuthenticationEnhancedView.swift b/ios/Classes/SmileIDSmartSelfieAuthenticationEnhancedView.swift new file mode 100644 index 00000000..bb161cc2 --- /dev/null +++ b/ios/Classes/SmileIDSmartSelfieAuthenticationEnhancedView.swift @@ -0,0 +1,47 @@ +import SwiftUI +import SmileID + +struct SmileIDSmartSelfieAuthenticationEnhancedView: View, SmartSelfieResultDelegate, SmileIDFileUtilsProtocol { + var fileManager: FileManager = Foundation.FileManager.default + + let creationParams: SmartSelfieEnhancedCreationParams + var completion: ((Result) -> Void)? + weak var uiViewController: UINavigationController? + + var body: some View { + VStack(alignment: .leading) { + Button("Back") { + completion?(.failure(PigeonError(code: "12", message: "User cancelled operation", details: nil))) + uiViewController?.popViewController(animated: true) + }.padding(.leading, 20) + + EnhancedSelfieAuthenticationRootView( + userId: creationParams.userId ?? "user-\(UUID().uuidString)", + allowNewEnroll: creationParams.allowNewEnroll, + showAttribution: creationParams.showAttribution, + showInstructions: creationParams.showInstructions, + extraPartnerParams: creationParams.extraPartnerParams ?? [:], + delegate: self + ).preferredColorScheme(.light) + } + } + + func didSucceed(selfieImage: URL, livenessImages: [URL], apiResponse: SmartSelfieResponse?) { + let result = SmartSelfieCaptureResult( + selfieFile: getFilePath(fileName: selfieImage.absoluteString), + livenessFiles: livenessImages.map { + getFilePath(fileName: $0.absoluteString) + }, + apiResponse: apiResponse?.buildResponse() + ) + + completion?(.success(result)) + uiViewController?.popViewController(animated: true) + } + + func didError(error: any Error) { + completion?(.failure(PigeonError(code: "15", message: error.localizedDescription, details: nil))) + uiViewController?.popViewController(animated: true) + } +} + diff --git a/ios/Classes/SmileIDSmartSelfieAuthenticationView.swift b/ios/Classes/SmileIDSmartSelfieAuthenticationView.swift new file mode 100644 index 00000000..ba6622b9 --- /dev/null +++ b/ios/Classes/SmileIDSmartSelfieAuthenticationView.swift @@ -0,0 +1,46 @@ +import SwiftUI +import SmileID + +struct SmileIDSmartSelfieAuthenticationView: View, SmartSelfieResultDelegate, SmileIDFileUtilsProtocol { + var fileManager: FileManager = Foundation.FileManager.default + + let creationParams: SmartSelfieCreationParams + var completion: ((Result) -> Void)? + weak var uiViewController: UINavigationController? + + var body: some View { + VStack(alignment: .leading) { + Button("Back") { + completion?(.failure(PigeonError(code: "12", message: "User cancelled operation", details: nil))) + uiViewController?.popViewController(animated: true) + }.padding(.leading, 20) + + SmileID.smartSelfieAuthenticationScreen( + userId: creationParams.userId ?? "user-\(UUID().uuidString)", + allowNewEnroll: creationParams.allowNewEnroll, + allowAgentMode: creationParams.allowAgentMode, + showAttribution: creationParams.showAttribution, + showInstructions: creationParams.showInstructions, + extraPartnerParams: creationParams.extraPartnerParams ?? [:], + delegate: self + ).preferredColorScheme(.light) + } + } + + func didSucceed(selfieImage: URL, livenessImages: [URL], apiResponse: SmartSelfieResponse?) { + let result = SmartSelfieCaptureResult( + selfieFile: getFilePath(fileName: selfieImage.absoluteString), + livenessFiles: livenessImages.map { + getFilePath(fileName: $0.absoluteString) + }, + apiResponse: apiResponse?.buildResponse() + ) + completion?(.success(result)) + uiViewController?.popViewController(animated: true) + } + + func didError(error: any Error) { + completion?(.failure(PigeonError(code: "13", message: error.localizedDescription, details: nil))) + uiViewController?.popViewController(animated: true) + } +} diff --git a/ios/Classes/SmileIDSmartSelfieEnrollmentEnhancedView.swift b/ios/Classes/SmileIDSmartSelfieEnrollmentEnhancedView.swift new file mode 100644 index 00000000..82a37582 --- /dev/null +++ b/ios/Classes/SmileIDSmartSelfieEnrollmentEnhancedView.swift @@ -0,0 +1,48 @@ +import SwiftUI +import SmileID + +struct SmileIDSmartSelfieEnrollmentEnhancedView: View, SmartSelfieResultDelegate, SmileIDFileUtilsProtocol { + var fileManager: FileManager = Foundation.FileManager.default + + let creationParams: SmartSelfieEnhancedCreationParams + var completion: ((Result) -> Void)? + weak var uiViewController: UINavigationController? + + var body: some View { + VStack(alignment: .leading) { + Button("Back") { + completion?(.failure(PigeonError(code: "12", message: "User cancelled operation", details: nil))) + uiViewController?.popViewController(animated: true) + }.padding(.leading, 20) + + EnhancedSelfieEnrollmentRootView( + userId: creationParams.userId ?? "user-\(UUID().uuidString)", + allowNewEnroll: creationParams.allowNewEnroll, + showAttribution: creationParams.showAttribution, + showInstructions: creationParams.showInstructions, + extraPartnerParams: creationParams.extraPartnerParams ?? [:], + delegate: self + ).preferredColorScheme(.light) + } + } + + func didSucceed(selfieImage: URL, livenessImages: [URL], apiResponse: SmartSelfieResponse?) { + let result = SmartSelfieCaptureResult( + selfieFile: getFilePath(fileName: selfieImage.absoluteString), + livenessFiles: livenessImages.map { + getFilePath(fileName: $0.absoluteString) + }, + apiResponse: apiResponse?.buildResponse() + ) + + completion?(.success(result)) + uiViewController?.popViewController(animated: true) + + } + + func didError(error: any Error) { + completion?(.failure(PigeonError(code: "14", message: error.localizedDescription, details: nil))) + uiViewController?.popViewController(animated: true) + } +} + diff --git a/ios/Classes/SmileIDSmartSelfieEnrollmentView.swift b/ios/Classes/SmileIDSmartSelfieEnrollmentView.swift new file mode 100644 index 00000000..444f8563 --- /dev/null +++ b/ios/Classes/SmileIDSmartSelfieEnrollmentView.swift @@ -0,0 +1,51 @@ +import SwiftUI +import SmileID +import Foundation +import Flutter + +struct SmileIDSmartSelfieEnrollmentView: View, SmartSelfieResultDelegate, SmileIDFileUtilsProtocol { + var fileManager: FileManager = Foundation.FileManager.default + + + let creationParams: SmartSelfieCreationParams + var completion: ((Result) -> Void)? + weak var uiViewController: UINavigationController? + + var body: some View { + VStack(alignment: .leading) { + Button("Back") { + completion?(.failure(PigeonError(code: "12", message: "User cancelled operation", details: nil))) + uiViewController?.popViewController(animated: true) + }.padding(.leading, 20) + + SmileID.smartSelfieEnrollmentScreen( + userId: creationParams.userId ?? "user-\(UUID().uuidString)", + allowNewEnroll: creationParams.allowNewEnroll, + allowAgentMode: creationParams.allowAgentMode, + showAttribution: creationParams.showAttribution, + showInstructions: creationParams.showInstructions, + skipApiSubmission: creationParams.skipApiSubmission, + extraPartnerParams: creationParams.extraPartnerParams ?? [:], + delegate: self + ).preferredColorScheme(.light) + } + } + + + func didSucceed(selfieImage: URL, livenessImages: [URL], apiResponse: SmartSelfieResponse?) { + let result = SmartSelfieCaptureResult( + selfieFile: getFilePath(fileName: selfieImage.absoluteString), + livenessFiles: livenessImages.map { + getFilePath(fileName: $0.absoluteString) + }, + apiResponse: apiResponse?.buildResponse() + ) + completion?(.success(result)) + uiViewController?.popViewController(animated: true) + } + + func didError(error: any Error) { + completion?(.failure(PigeonError(code: "12", message: error.localizedDescription, details: nil))) + uiViewController?.popViewController(animated: true) + } +} diff --git a/ios/Classes/SmileSelfieCaptureView.swift b/ios/Classes/SmileSelfieCaptureView.swift new file mode 100644 index 00000000..8668f2ee --- /dev/null +++ b/ios/Classes/SmileSelfieCaptureView.swift @@ -0,0 +1,86 @@ +import SwiftUI +import SmileID + +struct SmileSelfieCaptureView: View, SmileIDFileUtilsProtocol, SmartSelfieResultDelegate { + + + var fileManager: FileManager = Foundation.FileManager.default + @State private var acknowledgedInstructions = false + + let creationParams: SelfieCaptureViewCreationParams + let completion: ((Result) -> Void)? + weak var uiViewController: UINavigationController? + + @ObservedObject private var _viewModel: SelfieViewModel = SelfieViewModel( + isEnroll: false, + userId: generateUserId(), + jobId: generateJobId(), + allowNewEnroll: false, + skipApiSubmission: true, + extraPartnerParams: [:], + localMetadata: LocalMetadata() + ) + + var body: some View { + VStack(alignment: .leading) { + Button("Back") { + completion?(.failure(PigeonError(code: "19", message: "User cancelled operation", details: nil))) + uiViewController?.popViewController(animated: true) + }.padding(.leading, 20) + + NavigationView { + Group { + if creationParams.showInstructions, !acknowledgedInstructions { + SmartSelfieInstructionsScreen(showAttribution: creationParams.showAttribution) { + acknowledgedInstructions = true + } + .padding() + } else if _viewModel.processingState != nil { + Color.clear.onAppear { + self._viewModel.onFinished(callback: self) + } + } else if let selfieToConfirm = _viewModel.selfieToConfirm { + if (creationParams.showConfirmationDialog) { + ImageCaptureConfirmationDialog( + title: SmileIDResourcesHelper.localizedString(for: "Confirmation.GoodSelfie"), + subtitle: SmileIDResourcesHelper.localizedString(for: "Confirmation.FaceClear"), + image: UIImage(data: selfieToConfirm)!, + confirmationButtonText: SmileIDResourcesHelper.localizedString(for: "Confirmation.YesUse"), + onConfirm: _viewModel.submitJob, + retakeButtonText: SmileIDResourcesHelper.localizedString(for: "Confirmation.Retake"), + onRetake: _viewModel.onSelfieRejected, + scaleFactor: 1.25 + ).preferredColorScheme(.light) + } else { + Color.clear.onAppear { + self._viewModel.submitJob() + } + } + } else { + SelfieCaptureScreen( + viewModel: _viewModel, + allowAgentMode: creationParams.allowAgentMode + ).preferredColorScheme(.light) + } + } + } + } + } + + func didSucceed(selfieImage: URL, livenessImages: [URL], apiResponse: SmartSelfieResponse?) { + let result = SmartSelfieCaptureResult( + selfieFile: getFilePath(fileName: selfieImage.absoluteString), + livenessFiles: livenessImages.map{ + getFilePath(fileName: $0.absoluteString) + }, apiResponse: apiResponse?.buildResponse() + ) + + completion?(.success(result)) + uiViewController?.popViewController(animated: true) + } + + func didError(error: any Error) { + completion?(.failure(PigeonError(code: "19", message: error.localizedDescription, details: nil))) + uiViewController?.popViewController(animated: true) + } +} diff --git a/lib/smile_id.dart b/lib/smile_id.dart index 98885eb5..cec31b21 100644 --- a/lib/smile_id.dart +++ b/lib/smile_id.dart @@ -1,5 +1,7 @@ import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +import 'package:smile_id/smile_id_sdk_result.dart'; import 'smileid_messages.g.dart'; import 'smile_id_service.dart'; @@ -7,21 +9,23 @@ import 'smile_id_service.dart'; class SmileID { @visibleForTesting static SmileIDApi platformInterface = SmileIDApi(); + @visibleForTesting + static SmileIDProductsApi productsInterface = SmileIDProductsApi(); static SmileIDService api = SmileIDService(platformInterface); static void initializeWithApiKey({ required String apiKey, required FlutterConfig config, required bool useSandbox, - required bool enableCrashReporting - }){ + required bool enableCrashReporting, + }) { platformInterface.initializeWithApiKey(apiKey, config, useSandbox, enableCrashReporting); } static void initializeWithConfig({ required FlutterConfig config, required bool useSandbox, - required bool enableCrashReporting + required bool enableCrashReporting, }) { platformInterface.initializeWithConfig(config, useSandbox, enableCrashReporting); } @@ -32,11 +36,15 @@ class SmileID { platformInterface.initialize(useSandbox); } - static void setCallbackUrl({required Uri callbackUrl}) { + static void setCallbackUrl({ + required Uri callbackUrl, + }) { platformInterface.setCallbackUrl(callbackUrl.toString()); } - static void setAllowOfflineMode({required bool allowOfflineMode}) { + static void setAllowOfflineMode({ + required bool allowOfflineMode, + }) { platformInterface.setAllowOfflineMode(allowOfflineMode); } @@ -48,6 +56,105 @@ class SmileID { return platformInterface.getUnsubmittedJobs(); } + Future> smartSelfieEnrollment({ + required SmartSelfieCreationParams creationParams, + }) async { + try { + final result = await productsInterface.smartSelfieEnrollment(creationParams); + return SmileIDSdkResultSuccess(result); + } on PlatformException catch (e) { + return SmileIDSdkResultError(e.message ?? _defaultSdkErrorMessage); + } + } + + Future> smartSelfieAuthentication({ + required SmartSelfieCreationParams creationParams, + }) async { + try { + final result = await productsInterface.smartSelfieAuthentication(creationParams); + return SmileIDSdkResultSuccess(result); + } on PlatformException catch (e) { + return SmileIDSdkResultError(e.message ?? _defaultSdkErrorMessage); + } + } + + Future> smartSelfieEnrollmentEnhanced({ + required SmartSelfieEnhancedCreationParams creationParams, + }) async { + try { + final result = await productsInterface.smartSelfieEnrollmentEnhanced(creationParams); + return SmileIDSdkResultSuccess(result); + } on PlatformException catch (e) { + return SmileIDSdkResultError(e.message ?? _defaultSdkErrorMessage); + } + } + + Future> smartSelfieAuthenticationEnhanced({ + required SmartSelfieEnhancedCreationParams creationParams, + }) async { + try { + final result = await productsInterface.smartSelfieAuthenticationEnhanced(creationParams); + return SmileIDSdkResultSuccess(result); + } on PlatformException catch (e) { + return SmileIDSdkResultError(e.message ?? _defaultSdkErrorMessage); + } + } + + Future> documentVerification({ + required DocumentVerificationCreationParams creationParams, + }) async { + try { + final result = await productsInterface.documentVerification(creationParams); + return SmileIDSdkResultSuccess(result); + } on PlatformException catch (e) { + return SmileIDSdkResultError(e.message ?? _defaultSdkErrorMessage); + } + } + + Future> documentVerificationEnhanced({ + required DocumentVerificationEnhancedCreationParams creationParams, + }) async { + try { + final result = await productsInterface.documentVerificationEnhanced(creationParams); + return SmileIDSdkResultSuccess(result); + } on PlatformException catch (e) { + return SmileIDSdkResultError(e.message ?? _defaultSdkErrorMessage); + } + } + + Future> biometricKYC({ + required BiometricKYCCreationParams creationParams, + }) async { + try { + final result = await productsInterface.biometricKYC(creationParams); + return SmileIDSdkResultSuccess(result); + } on PlatformException catch (e) { + return SmileIDSdkResultError(e.message ?? _defaultSdkErrorMessage); + } + } + + Future> selfieCapture({ + required SelfieCaptureViewCreationParams creationParams, + }) async { + try { + final result = await productsInterface.selfieCapture(creationParams); + return SmileIDSdkResultSuccess(result); + } on PlatformException catch (e) { + return SmileIDSdkResultError(e.message ?? _defaultSdkErrorMessage); + } + } + + Future> documentCapture({ + required DocumentCaptureCreationParams creationParams, + }) async { + try { + final result = await productsInterface.documentCapture(creationParams); + return SmileIDSdkResultSuccess(result); + } on PlatformException catch (e) { + return SmileIDSdkResultError(e.message ?? _defaultSdkErrorMessage); + } + } + static void cleanup(String jobId) { platformInterface.cleanup(jobId); } @@ -60,3 +167,5 @@ class SmileID { platformInterface.submitJob(jobId, deleteFilesOnSuccess); } } + +const _defaultSdkErrorMessage = "An error occurred communicating with the sdk"; diff --git a/lib/smile_id_biometric_kyc.dart b/lib/smile_id_biometric_kyc.dart index 9bef7c30..152588d4 100644 --- a/lib/smile_id_biometric_kyc.dart +++ b/lib/smile_id_biometric_kyc.dart @@ -4,6 +4,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +@Deprecated( + 'Due to the expensive nature of platform views, migrate to the more efficient biometricKYC function in the SmileID sdk. This widget will be removed in future versions', +) class SmileIDBiometricKYC extends StatelessWidget { static const String viewType = "SmileIDBiometricKYC"; final Map creationParams; diff --git a/lib/smile_id_document_capture_view.dart b/lib/smile_id_document_capture_view.dart index d50b8378..dc105f2b 100644 --- a/lib/smile_id_document_capture_view.dart +++ b/lib/smile_id_document_capture_view.dart @@ -4,6 +4,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +@Deprecated( + 'Due to the expensive nature of platform views, migrate to the more efficient documentCapture function in the SmileID sdk. This widget will be removed in future versions', +) class SmileIDDocumentCaptureView extends StatelessWidget { static const String viewType = "SmileIDDocumentCaptureView"; final Map creationParams; diff --git a/lib/smile_id_document_verification.dart b/lib/smile_id_document_verification.dart index c7e3f634..41c344fe 100644 --- a/lib/smile_id_document_verification.dart +++ b/lib/smile_id_document_verification.dart @@ -4,6 +4,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +@Deprecated( + 'Due to the expensive nature of platform views, migrate to the more efficient documentVerification function in the SmileID sdk. This widget will be removed in future versions', +) class SmileIDDocumentVerification extends StatelessWidget { static const String viewType = "SmileIDDocumentVerification"; final Map creationParams; @@ -56,8 +59,8 @@ class SmileIDDocumentVerification extends StatelessWidget { "allowAgentMode": allowAgentMode, "allowGalleryUpload": allowGalleryUpload, "showInstructions": showInstructions, - "skipApiSubmission" : skipApiSubmission, - "extraPartnerParams" : extraPartnerParams, + "skipApiSubmission": skipApiSubmission, + "extraPartnerParams": extraPartnerParams, }, ); } diff --git a/lib/smile_id_enhanced_document_verification.dart b/lib/smile_id_enhanced_document_verification.dart index ef96ea6b..59eb4e21 100644 --- a/lib/smile_id_enhanced_document_verification.dart +++ b/lib/smile_id_enhanced_document_verification.dart @@ -4,6 +4,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +@Deprecated( + 'Due to the expensive nature of platform views, migrate to the more efficient documentVerificationEnhanced function in the SmileID sdk. This widget will be removed in future versions', +) class SmileIDEnhancedDocumentVerification extends StatelessWidget { static const String viewType = "SmileIDEnhancedDocumentVerification"; final Map creationParams; @@ -55,8 +58,8 @@ class SmileIDEnhancedDocumentVerification extends StatelessWidget { "allowAgentMode": allowAgentMode, "allowGalleryUpload": allowGalleryUpload, "showInstructions": showInstructions, - "skipApiSubmission" : skipApiSubmission, - "extraPartnerParams" : extraPartnerParams, + "skipApiSubmission": skipApiSubmission, + "extraPartnerParams": extraPartnerParams, }, ); } diff --git a/lib/smile_id_sdk_result.dart b/lib/smile_id_sdk_result.dart new file mode 100644 index 00000000..4e1861a5 --- /dev/null +++ b/lib/smile_id_sdk_result.dart @@ -0,0 +1,18 @@ +/// A sealed class representing the result of an operation in the Smile ID SDK. +/// This class is intended to be extended by specific result types +/// such as [SmileIDSdkResultSuccess] and [SmileIDSdkResultError]. +sealed class SmileIDSdkResult { + const SmileIDSdkResult(); +} + +final class SmileIDSdkResultSuccess extends SmileIDSdkResult { + final T data; + + const SmileIDSdkResultSuccess(this.data); +} + +final class SmileIDSdkResultError extends SmileIDSdkResult { + final String error; + + const SmileIDSdkResultError(this.error); +} diff --git a/lib/smile_id_smart_selfie_authentication.dart b/lib/smile_id_smart_selfie_authentication.dart index 2d7655cc..1aa4de26 100644 --- a/lib/smile_id_smart_selfie_authentication.dart +++ b/lib/smile_id_smart_selfie_authentication.dart @@ -4,6 +4,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +@Deprecated( + 'Due to the expensive nature of platform views, migrate to the more efficient smartSelfieAuthentication function in the SmileID sdk. This widget will be removed in future versions', +) class SmileIDSmartSelfieAuthentication extends StatelessWidget { static const String viewType = "SmileIDSmartSelfieAuthentication"; final Map creationParams; diff --git a/lib/smile_id_smart_selfie_authentication_enhanced.dart b/lib/smile_id_smart_selfie_authentication_enhanced.dart index bb888c30..e9df138c 100644 --- a/lib/smile_id_smart_selfie_authentication_enhanced.dart +++ b/lib/smile_id_smart_selfie_authentication_enhanced.dart @@ -4,6 +4,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +@Deprecated( + 'Due to the expensive nature of platform views, migrate to the more efficient smartSelfieAuthenticationEnhanced function in the SmileID sdk. This widget will be removed in future versions', +) class SmileIDSmartSelfieAuthenticationEnhanced extends StatelessWidget { static const String viewType = "SmileIDSmartSelfieAuthenticationEnhanced"; final Map creationParams; @@ -39,7 +42,7 @@ class SmileIDSmartSelfieAuthenticationEnhanced extends StatelessWidget { "allowNewEnroll": allowNewEnroll, "showAttribution": showAttribution, "showInstructions": showInstructions, - "extraPartnerParams" : extraPartnerParams, + "extraPartnerParams": extraPartnerParams, }, ); } diff --git a/lib/smile_id_smart_selfie_capture_view.dart b/lib/smile_id_smart_selfie_capture_view.dart index ced7c1cf..77c07b83 100644 --- a/lib/smile_id_smart_selfie_capture_view.dart +++ b/lib/smile_id_smart_selfie_capture_view.dart @@ -4,6 +4,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +@Deprecated( + 'Due to the expensive nature of platform views, migrate to the more efficient selfieCapture function in the SmileID sdk. This widget will be removed in future versions', +) class SmileIDSmartSelfieCaptureView extends StatelessWidget { static const String viewType = "SmileIDSmartSelfieCaptureView"; final Map creationParams; diff --git a/lib/smile_id_smart_selfie_enrollment.dart b/lib/smile_id_smart_selfie_enrollment.dart index c310b282..aab22630 100644 --- a/lib/smile_id_smart_selfie_enrollment.dart +++ b/lib/smile_id_smart_selfie_enrollment.dart @@ -4,6 +4,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +@Deprecated( + 'Due to the expensive nature of platform views, migrate to the more efficient smartSelfieEnrollment function in the SmileID sdk. This widget will be removed in future versions', +) class SmileIDSmartSelfieEnrollment extends StatelessWidget { static const String viewType = "SmileIDSmartSelfieEnrollment"; final Map creationParams; @@ -42,8 +45,8 @@ class SmileIDSmartSelfieEnrollment extends StatelessWidget { "allowAgentMode": allowAgentMode, "showAttribution": showAttribution, "showInstructions": showInstructions, - "extraPartnerParams" : extraPartnerParams, - "skipApiSubmission" : skipApiSubmission, + "extraPartnerParams": extraPartnerParams, + "skipApiSubmission": skipApiSubmission, }, ); } diff --git a/lib/smile_id_smart_selfie_enrollment_enhanced.dart b/lib/smile_id_smart_selfie_enrollment_enhanced.dart index 3a4b7dce..ee40bf5e 100644 --- a/lib/smile_id_smart_selfie_enrollment_enhanced.dart +++ b/lib/smile_id_smart_selfie_enrollment_enhanced.dart @@ -4,6 +4,9 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +@Deprecated( + 'Due to the expensive nature of platform views, migrate to the more efficient smartSelfieEnrollmentEnhanced function in the SmileID sdk. This widget will be removed in future versions', +) class SmileIDSmartSelfieEnrollmentEnhanced extends StatelessWidget { static const String viewType = "SmileIDSmartSelfieEnrollmentEnhanced"; final Map creationParams; diff --git a/lib/smileid_messages.g.dart b/lib/smileid_messages.g.dart index 6b8e488c..88e8f866 100644 --- a/lib/smileid_messages.g.dart +++ b/lib/smileid_messages.g.dart @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v16.0.5), do not edit directly. +// Autogenerated from Pigeon (v22.7.1), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers @@ -87,7 +87,7 @@ class FlutterPartnerParams { Object encode() { return [ - jobType?.index, + jobType, jobId, userId, extras, @@ -97,9 +97,7 @@ class FlutterPartnerParams { static FlutterPartnerParams decode(Object result) { result as List; return FlutterPartnerParams( - jobType: result[0] != null - ? FlutterJobType.values[result[0]! as int] - : null, + jobType: result[0] as FlutterJobType?, jobId: result[1]! as String, userId: result[2]! as String, extras: (result[3] as Map?)?.cast(), @@ -107,6 +105,556 @@ class FlutterPartnerParams { } } +class SmartSelfieCreationParams { + SmartSelfieCreationParams({ + this.userId, + required this.allowNewEnroll, + required this.allowAgentMode, + required this.showAttribution, + required this.showInstructions, + required this.skipApiSubmission, + this.extraPartnerParams, + }); + + String? userId; + + bool allowNewEnroll; + + bool allowAgentMode; + + bool showAttribution; + + bool showInstructions; + + bool skipApiSubmission; + + Map? extraPartnerParams; + + Object encode() { + return [ + userId, + allowNewEnroll, + allowAgentMode, + showAttribution, + showInstructions, + skipApiSubmission, + extraPartnerParams, + ]; + } + + static SmartSelfieCreationParams decode(Object result) { + result as List; + return SmartSelfieCreationParams( + userId: result[0] as String?, + allowNewEnroll: result[1]! as bool, + allowAgentMode: result[2]! as bool, + showAttribution: result[3]! as bool, + showInstructions: result[4]! as bool, + skipApiSubmission: result[5]! as bool, + extraPartnerParams: (result[6] as Map?)?.cast(), + ); + } +} + +class SmartSelfieEnhancedCreationParams { + SmartSelfieEnhancedCreationParams({ + this.userId, + required this.allowNewEnroll, + required this.showAttribution, + required this.showInstructions, + this.extraPartnerParams, + }); + + String? userId; + + bool allowNewEnroll; + + bool showAttribution; + + bool showInstructions; + + Map? extraPartnerParams; + + Object encode() { + return [ + userId, + allowNewEnroll, + showAttribution, + showInstructions, + extraPartnerParams, + ]; + } + + static SmartSelfieEnhancedCreationParams decode(Object result) { + result as List; + return SmartSelfieEnhancedCreationParams( + userId: result[0] as String?, + allowNewEnroll: result[1]! as bool, + showAttribution: result[2]! as bool, + showInstructions: result[3]! as bool, + extraPartnerParams: (result[4] as Map?)?.cast(), + ); + } +} + +class SmartSelfieCaptureResult { + SmartSelfieCaptureResult({ + this.selfieFile, + this.livenessFiles, + this.apiResponse, + }); + + String? selfieFile; + + List? livenessFiles; + + Map? apiResponse; + + Object encode() { + return [ + selfieFile, + livenessFiles, + apiResponse, + ]; + } + + static SmartSelfieCaptureResult decode(Object result) { + result as List; + return SmartSelfieCaptureResult( + selfieFile: result[0] as String?, + livenessFiles: (result[1] as List?)?.cast(), + apiResponse: (result[2] as Map?)?.cast(), + ); + } +} + +class DocumentVerificationCreationParams { + DocumentVerificationCreationParams({ + required this.countryCode, + this.documentType, + this.idAspectRatio, + required this.captureBothSides, + this.bypassSelfieCaptureWithFile, + this.userId, + this.jobId, + required this.allowNewEnroll, + required this.showAttribution, + required this.allowGalleryUpload, + required this.allowAgentMode, + required this.showInstructions, + required this.skipApiSubmission, + this.extraPartnerParams, + }); + + String countryCode; + + String? documentType; + + double? idAspectRatio; + + bool captureBothSides; + + String? bypassSelfieCaptureWithFile; + + String? userId; + + String? jobId; + + bool allowNewEnroll; + + bool showAttribution; + + bool allowGalleryUpload; + + bool allowAgentMode; + + bool showInstructions; + + bool skipApiSubmission; + + Map? extraPartnerParams; + + Object encode() { + return [ + countryCode, + documentType, + idAspectRatio, + captureBothSides, + bypassSelfieCaptureWithFile, + userId, + jobId, + allowNewEnroll, + showAttribution, + allowGalleryUpload, + allowAgentMode, + showInstructions, + skipApiSubmission, + extraPartnerParams, + ]; + } + + static DocumentVerificationCreationParams decode(Object result) { + result as List; + return DocumentVerificationCreationParams( + countryCode: result[0]! as String, + documentType: result[1] as String?, + idAspectRatio: result[2] as double?, + captureBothSides: result[3]! as bool, + bypassSelfieCaptureWithFile: result[4] as String?, + userId: result[5] as String?, + jobId: result[6] as String?, + allowNewEnroll: result[7]! as bool, + showAttribution: result[8]! as bool, + allowGalleryUpload: result[9]! as bool, + allowAgentMode: result[10]! as bool, + showInstructions: result[11]! as bool, + skipApiSubmission: result[12]! as bool, + extraPartnerParams: (result[13] as Map?)?.cast(), + ); + } +} + +class DocumentVerificationEnhancedCreationParams { + DocumentVerificationEnhancedCreationParams({ + required this.countryCode, + this.documentType, + this.idAspectRatio, + required this.captureBothSides, + this.bypassSelfieCaptureWithFile, + this.userId, + this.jobId, + required this.allowNewEnroll, + required this.showAttribution, + required this.allowAgentMode, + required this.allowGalleryUpload, + required this.showInstructions, + required this.skipApiSubmission, + this.extraPartnerParams, + }); + + String countryCode; + + String? documentType; + + double? idAspectRatio; + + bool captureBothSides; + + String? bypassSelfieCaptureWithFile; + + String? userId; + + String? jobId; + + bool allowNewEnroll; + + bool showAttribution; + + bool allowAgentMode; + + bool allowGalleryUpload; + + bool showInstructions; + + bool skipApiSubmission; + + Map? extraPartnerParams; + + Object encode() { + return [ + countryCode, + documentType, + idAspectRatio, + captureBothSides, + bypassSelfieCaptureWithFile, + userId, + jobId, + allowNewEnroll, + showAttribution, + allowAgentMode, + allowGalleryUpload, + showInstructions, + skipApiSubmission, + extraPartnerParams, + ]; + } + + static DocumentVerificationEnhancedCreationParams decode(Object result) { + result as List; + return DocumentVerificationEnhancedCreationParams( + countryCode: result[0]! as String, + documentType: result[1] as String?, + idAspectRatio: result[2] as double?, + captureBothSides: result[3]! as bool, + bypassSelfieCaptureWithFile: result[4] as String?, + userId: result[5] as String?, + jobId: result[6] as String?, + allowNewEnroll: result[7]! as bool, + showAttribution: result[8]! as bool, + allowAgentMode: result[9]! as bool, + allowGalleryUpload: result[10]! as bool, + showInstructions: result[11]! as bool, + skipApiSubmission: result[12]! as bool, + extraPartnerParams: (result[13] as Map?)?.cast(), + ); + } +} + +class DocumentCaptureResult { + DocumentCaptureResult({ + this.selfieFile, + this.documentFrontFile, + this.livenessFiles, + this.documentBackFile, + this.didSubmitDocumentVerificationJob, + this.didSubmitEnhancedDocVJob, + }); + + String? selfieFile; + + String? documentFrontFile; + + List? livenessFiles; + + String? documentBackFile; + + bool? didSubmitDocumentVerificationJob; + + bool? didSubmitEnhancedDocVJob; + + Object encode() { + return [ + selfieFile, + documentFrontFile, + livenessFiles, + documentBackFile, + didSubmitDocumentVerificationJob, + didSubmitEnhancedDocVJob, + ]; + } + + static DocumentCaptureResult decode(Object result) { + result as List; + return DocumentCaptureResult( + selfieFile: result[0] as String?, + documentFrontFile: result[1] as String?, + livenessFiles: (result[2] as List?)?.cast(), + documentBackFile: result[3] as String?, + didSubmitDocumentVerificationJob: result[4] as bool?, + didSubmitEnhancedDocVJob: result[5] as bool?, + ); + } +} + +class BiometricKYCCreationParams { + BiometricKYCCreationParams({ + this.country, + this.idType, + this.idNumber, + this.firstName, + this.middleName, + this.lastName, + this.dob, + this.bankCode, + this.entered, + this.userId, + this.jobId, + required this.allowNewEnroll, + required this.allowAgentMode, + required this.showAttribution, + required this.showInstructions, + this.extraPartnerParams, + }); + + String? country; + + String? idType; + + String? idNumber; + + String? firstName; + + String? middleName; + + String? lastName; + + String? dob; + + String? bankCode; + + bool? entered; + + String? userId; + + String? jobId; + + bool allowNewEnroll; + + bool allowAgentMode; + + bool showAttribution; + + bool showInstructions; + + Map? extraPartnerParams; + + Object encode() { + return [ + country, + idType, + idNumber, + firstName, + middleName, + lastName, + dob, + bankCode, + entered, + userId, + jobId, + allowNewEnroll, + allowAgentMode, + showAttribution, + showInstructions, + extraPartnerParams, + ]; + } + + static BiometricKYCCreationParams decode(Object result) { + result as List; + return BiometricKYCCreationParams( + country: result[0] as String?, + idType: result[1] as String?, + idNumber: result[2] as String?, + firstName: result[3] as String?, + middleName: result[4] as String?, + lastName: result[5] as String?, + dob: result[6] as String?, + bankCode: result[7] as String?, + entered: result[8] as bool?, + userId: result[9] as String?, + jobId: result[10] as String?, + allowNewEnroll: result[11]! as bool, + allowAgentMode: result[12]! as bool, + showAttribution: result[13]! as bool, + showInstructions: result[14]! as bool, + extraPartnerParams: (result[15] as Map?)?.cast(), + ); + } +} + +class BiometricKYCCaptureResult { + BiometricKYCCaptureResult({ + this.selfieFile, + this.livenessFiles, + this.didSubmitBiometricKycJob, + }); + + String? selfieFile; + + List? livenessFiles; + + bool? didSubmitBiometricKycJob; + + Object encode() { + return [ + selfieFile, + livenessFiles, + didSubmitBiometricKycJob, + ]; + } + + static BiometricKYCCaptureResult decode(Object result) { + result as List; + return BiometricKYCCaptureResult( + selfieFile: result[0] as String?, + livenessFiles: (result[1] as List?)?.cast(), + didSubmitBiometricKycJob: result[2] as bool?, + ); + } +} + +class SelfieCaptureViewCreationParams { + SelfieCaptureViewCreationParams({ + required this.showConfirmationDialog, + required this.showInstructions, + required this.showAttribution, + required this.allowAgentMode, + }); + + bool showConfirmationDialog; + + bool showInstructions; + + bool showAttribution; + + bool allowAgentMode; + + Object encode() { + return [ + showConfirmationDialog, + showInstructions, + showAttribution, + allowAgentMode, + ]; + } + + static SelfieCaptureViewCreationParams decode(Object result) { + result as List; + return SelfieCaptureViewCreationParams( + showConfirmationDialog: result[0]! as bool, + showInstructions: result[1]! as bool, + showAttribution: result[2]! as bool, + allowAgentMode: result[3]! as bool, + ); + } +} + +class DocumentCaptureCreationParams { + DocumentCaptureCreationParams({ + required this.isDocumentFrontSide, + required this.showInstructions, + required this.showAttribution, + required this.allowGalleryUpload, + required this.showConfirmationDialog, + this.idAspectRatio, + }); + + bool isDocumentFrontSide; + + bool showInstructions; + + bool showAttribution; + + bool allowGalleryUpload; + + bool showConfirmationDialog; + + double? idAspectRatio; + + Object encode() { + return [ + isDocumentFrontSide, + showInstructions, + showAttribution, + allowGalleryUpload, + showConfirmationDialog, + idAspectRatio, + ]; + } + + static DocumentCaptureCreationParams decode(Object result) { + result as List; + return DocumentCaptureCreationParams( + isDocumentFrontSide: result[0]! as bool, + showInstructions: result[1]! as bool, + showAttribution: result[2]! as bool, + allowGalleryUpload: result[3]! as bool, + showConfirmationDialog: result[4]! as bool, + idAspectRatio: result[5] as double?, + ); + } +} + /// The Auth Smile request. Auth Smile serves multiple purposes: /// /// - It is used to fetch the signature needed for subsequent API requests @@ -148,7 +696,7 @@ class FlutterAuthenticationRequest { Object encode() { return [ - jobType.index, + jobType, country, idType, updateEnrolledImage, @@ -160,7 +708,7 @@ class FlutterAuthenticationRequest { static FlutterAuthenticationRequest decode(Object result) { result as List; return FlutterAuthenticationRequest( - jobType: FlutterJobType.values[result[0]! as int], + jobType: result[0]! as FlutterJobType, country: result[1] as String?, idType: result[2] as String?, updateEnrolledImage: result[3] as bool?, @@ -203,9 +751,9 @@ class FlutterAuthenticationResponse { success, signature, timestamp, - partnerParams.encode(), + partnerParams, callbackUrl, - consentInfo?.encode(), + consentInfo, ]; } @@ -215,11 +763,9 @@ class FlutterAuthenticationResponse { success: result[0]! as bool, signature: result[1]! as String, timestamp: result[2]! as String, - partnerParams: FlutterPartnerParams.decode(result[3]! as List), + partnerParams: result[3]! as FlutterPartnerParams, callbackUrl: result[4] as String?, - consentInfo: result[5] != null - ? FlutterConsentInfo.decode(result[5]! as List) - : null, + consentInfo: result[5] as FlutterConsentInfo?, ); } } @@ -248,7 +794,7 @@ class FlutterPrepUploadRequest { Object encode() { return [ - partnerParams.encode(), + partnerParams, callbackUrl, allowNewEnroll, partnerId, @@ -260,7 +806,7 @@ class FlutterPrepUploadRequest { static FlutterPrepUploadRequest decode(Object result) { result as List; return FlutterPrepUploadRequest( - partnerParams: FlutterPartnerParams.decode(result[0]! as List), + partnerParams: result[0]! as FlutterPartnerParams, callbackUrl: result[1] as String?, allowNewEnroll: result[2]! as bool, partnerId: result[3]! as String, @@ -319,7 +865,7 @@ class FlutterUploadRequest { Object encode() { return [ images, - idInfo?.encode(), + idInfo, ]; } @@ -327,9 +873,7 @@ class FlutterUploadRequest { result as List; return FlutterUploadRequest( images: (result[0] as List?)!.cast(), - idInfo: result[1] != null - ? FlutterIdInfo.decode(result[1]! as List) - : null, + idInfo: result[1] as FlutterIdInfo?, ); } } @@ -346,7 +890,7 @@ class FlutterUploadImageInfo { Object encode() { return [ - imageTypeId.index, + imageTypeId, imageName, ]; } @@ -354,7 +898,7 @@ class FlutterUploadImageInfo { static FlutterUploadImageInfo decode(Object result) { result as List; return FlutterUploadImageInfo( - imageTypeId: FlutterImageType.values[result[0]! as int], + imageTypeId: result[0]! as FlutterImageType, imageName: result[1]! as String, ); } @@ -464,10 +1008,10 @@ class FlutterEnhancedKycResponse { Object encode() { return [ smileJobId, - partnerParams.encode(), + partnerParams, resultText, resultCode, - actions.encode(), + actions, country, idType, idNumber, @@ -482,10 +1026,10 @@ class FlutterEnhancedKycResponse { result as List; return FlutterEnhancedKycResponse( smileJobId: result[0]! as String, - partnerParams: FlutterPartnerParams.decode(result[1]! as List), + partnerParams: result[1]! as FlutterPartnerParams, resultText: result[2]! as String, resultCode: result[3]! as String, - actions: FlutterActions.decode(result[4]! as List), + actions: result[4]! as FlutterActions, country: result[5]! as String, idType: result[6]! as String, idNumber: result[7]! as String, @@ -554,46 +1098,46 @@ class FlutterActions { Object encode() { return [ - documentCheck.index, - humanReviewCompare.index, - humanReviewDocumentCheck.index, - humanReviewLivenessCheck.index, - humanReviewSelfieCheck.index, - humanReviewUpdateSelfie.index, - livenessCheck.index, - registerSelfie.index, - returnPersonalInfo.index, - selfieCheck.index, - selfieProvided.index, - selfieToIdAuthorityCompare.index, - selfieToIdCardCompare.index, - selfieToRegisteredSelfieCompare.index, - updateRegisteredSelfieOnFile.index, - verifyDocument.index, - verifyIdNumber.index, + documentCheck, + humanReviewCompare, + humanReviewDocumentCheck, + humanReviewLivenessCheck, + humanReviewSelfieCheck, + humanReviewUpdateSelfie, + livenessCheck, + registerSelfie, + returnPersonalInfo, + selfieCheck, + selfieProvided, + selfieToIdAuthorityCompare, + selfieToIdCardCompare, + selfieToRegisteredSelfieCompare, + updateRegisteredSelfieOnFile, + verifyDocument, + verifyIdNumber, ]; } static FlutterActions decode(Object result) { result as List; return FlutterActions( - documentCheck: FlutterActionResult.values[result[0]! as int], - humanReviewCompare: FlutterActionResult.values[result[1]! as int], - humanReviewDocumentCheck: FlutterActionResult.values[result[2]! as int], - humanReviewLivenessCheck: FlutterActionResult.values[result[3]! as int], - humanReviewSelfieCheck: FlutterActionResult.values[result[4]! as int], - humanReviewUpdateSelfie: FlutterActionResult.values[result[5]! as int], - livenessCheck: FlutterActionResult.values[result[6]! as int], - registerSelfie: FlutterActionResult.values[result[7]! as int], - returnPersonalInfo: FlutterActionResult.values[result[8]! as int], - selfieCheck: FlutterActionResult.values[result[9]! as int], - selfieProvided: FlutterActionResult.values[result[10]! as int], - selfieToIdAuthorityCompare: FlutterActionResult.values[result[11]! as int], - selfieToIdCardCompare: FlutterActionResult.values[result[12]! as int], - selfieToRegisteredSelfieCompare: FlutterActionResult.values[result[13]! as int], - updateRegisteredSelfieOnFile: FlutterActionResult.values[result[14]! as int], - verifyDocument: FlutterActionResult.values[result[15]! as int], - verifyIdNumber: FlutterActionResult.values[result[16]! as int], + documentCheck: result[0]! as FlutterActionResult, + humanReviewCompare: result[1]! as FlutterActionResult, + humanReviewDocumentCheck: result[2]! as FlutterActionResult, + humanReviewLivenessCheck: result[3]! as FlutterActionResult, + humanReviewSelfieCheck: result[4]! as FlutterActionResult, + humanReviewUpdateSelfie: result[5]! as FlutterActionResult, + livenessCheck: result[6]! as FlutterActionResult, + registerSelfie: result[7]! as FlutterActionResult, + returnPersonalInfo: result[8]! as FlutterActionResult, + selfieCheck: result[9]! as FlutterActionResult, + selfieProvided: result[10]! as FlutterActionResult, + selfieToIdAuthorityCompare: result[11]! as FlutterActionResult, + selfieToIdCardCompare: result[12]! as FlutterActionResult, + selfieToRegisteredSelfieCompare: result[13]! as FlutterActionResult, + updateRegisteredSelfieOnFile: result[14]! as FlutterActionResult, + verifyDocument: result[15]! as FlutterActionResult, + verifyIdNumber: result[16]! as FlutterActionResult, ); } } @@ -683,7 +1227,7 @@ class FlutterEnhancedKycRequest { phoneNumber, bankCode, callbackUrl, - partnerParams.encode(), + partnerParams, timestamp, signature, ]; @@ -702,7 +1246,7 @@ class FlutterEnhancedKycRequest { phoneNumber: result[7] as String?, bankCode: result[8] as String?, callbackUrl: result[9] as String?, - partnerParams: FlutterPartnerParams.decode(result[10]! as List), + partnerParams: result[10]! as FlutterPartnerParams, timestamp: result[11]! as String, signature: result[12]! as String, ); @@ -878,11 +1422,11 @@ class FlutterSmartSelfieJobResult { Object encode() { return [ - actions.encode(), + actions, resultCode, resultText, smileJobId, - partnerParams.encode(), + partnerParams, confidence, ]; } @@ -890,11 +1434,11 @@ class FlutterSmartSelfieJobResult { static FlutterSmartSelfieJobResult decode(Object result) { result as List; return FlutterSmartSelfieJobResult( - actions: FlutterActions.decode(result[0]! as List), + actions: result[0]! as FlutterActions, resultCode: result[1]! as String, resultText: result[2]! as String, smileJobId: result[3]! as String, - partnerParams: FlutterPartnerParams.decode(result[4]! as List), + partnerParams: result[4]! as FlutterPartnerParams, confidence: result[5] as double?, ); } @@ -934,10 +1478,10 @@ class FlutterSmartSelfieJobStatusResponse { jobComplete, jobSuccess, code, - result?.encode(), + result, resultString, history, - imageLinks?.encode(), + imageLinks, ]; } @@ -948,14 +1492,10 @@ class FlutterSmartSelfieJobStatusResponse { jobComplete: result[1]! as bool, jobSuccess: result[2]! as bool, code: result[3]! as String, - result: result[4] != null - ? FlutterSmartSelfieJobResult.decode(result[4]! as List) - : null, + result: result[4] as FlutterSmartSelfieJobResult?, resultString: result[5] as String?, history: (result[6] as List?)?.cast(), - imageLinks: result[7] != null - ? FlutterImageLinks.decode(result[7]! as List) - : null, + imageLinks: result[7] as FlutterImageLinks?, ); } } @@ -999,11 +1539,11 @@ class FlutterSmartSelfieResponse { code, createdAt, jobId, - jobType.index, + jobType, message, partnerId, partnerParams, - status.index, + status, updatedAt, userId, ]; @@ -1015,11 +1555,11 @@ class FlutterSmartSelfieResponse { code: result[0]! as String, createdAt: result[1]! as String, jobId: result[2]! as String, - jobType: FlutterJobTypeV2.values[result[3]! as int], + jobType: result[3]! as FlutterJobTypeV2, message: result[4]! as String, partnerId: result[5]! as String, partnerParams: (result[6] as Map?)?.cast(), - status: FlutterSmartSelfieStatus.values[result[7]! as int], + status: result[7]! as FlutterSmartSelfieStatus, updatedAt: result[8]! as String, userId: result[9]! as String, ); @@ -1080,11 +1620,11 @@ class FlutterDocumentVerificationJobResult { Object encode() { return [ - actions.encode(), + actions, resultCode, resultText, smileJobId, - partnerParams.encode(), + partnerParams, country, idType, idNumber, @@ -1102,11 +1642,11 @@ class FlutterDocumentVerificationJobResult { static FlutterDocumentVerificationJobResult decode(Object result) { result as List; return FlutterDocumentVerificationJobResult( - actions: FlutterActions.decode(result[0]! as List), + actions: result[0]! as FlutterActions, resultCode: result[1]! as String, resultText: result[2]! as String, smileJobId: result[3]! as String, - partnerParams: FlutterPartnerParams.decode(result[4]! as List), + partnerParams: result[4]! as FlutterPartnerParams, country: result[5] as String?, idType: result[6] as String?, idNumber: result[7] as String?, @@ -1156,10 +1696,10 @@ class FlutterDocumentVerificationJobStatusResponse { jobComplete, jobSuccess, code, - result?.encode(), + result, resultString, history, - imageLinks?.encode(), + imageLinks, ]; } @@ -1170,14 +1710,10 @@ class FlutterDocumentVerificationJobStatusResponse { jobComplete: result[1]! as bool, jobSuccess: result[2]! as bool, code: result[3]! as String, - result: result[4] != null - ? FlutterDocumentVerificationJobResult.decode(result[4]! as List) - : null, + result: result[4] as FlutterDocumentVerificationJobResult?, resultString: result[5] as String?, history: (result[6] as List?)?.cast(), - imageLinks: result[7] != null - ? FlutterImageLinks.decode(result[7]! as List) - : null, + imageLinks: result[7] as FlutterImageLinks?, ); } } @@ -1257,13 +1793,13 @@ class FlutterBiometricKycJobResult { Object encode() { return [ - actions.encode(), + actions, resultCode, resultText, resultType, smileJobId, - partnerParams.encode(), - antifraud?.encode(), + partnerParams, + antifraud, dob, photoBase64, gender, @@ -1286,15 +1822,13 @@ class FlutterBiometricKycJobResult { static FlutterBiometricKycJobResult decode(Object result) { result as List; return FlutterBiometricKycJobResult( - actions: FlutterActions.decode(result[0]! as List), + actions: result[0]! as FlutterActions, resultCode: result[1]! as String, resultText: result[2]! as String, resultType: result[3]! as String, smileJobId: result[4]! as String, - partnerParams: FlutterPartnerParams.decode(result[5]! as List), - antifraud: result[6] != null - ? FlutterAntifraud.decode(result[6]! as List) - : null, + partnerParams: result[5]! as FlutterPartnerParams, + antifraud: result[6] as FlutterAntifraud?, dob: result[7] as String?, photoBase64: result[8] as String?, gender: result[9] as String?, @@ -1349,10 +1883,10 @@ class FlutterBiometricKycJobStatusResponse { jobComplete, jobSuccess, code, - result?.encode(), + result, resultString, history, - imageLinks?.encode(), + imageLinks, ]; } @@ -1363,14 +1897,10 @@ class FlutterBiometricKycJobStatusResponse { jobComplete: result[1]! as bool, jobSuccess: result[2]! as bool, code: result[3]! as String, - result: result[4] != null - ? FlutterBiometricKycJobResult.decode(result[4]! as List) - : null, + result: result[4] as FlutterBiometricKycJobResult?, resultString: result[5] as String?, history: (result[6] as List?)?.cast(), - imageLinks: result[7] != null - ? FlutterImageLinks.decode(result[7]! as List) - : null, + imageLinks: result[7] as FlutterImageLinks?, ); } } @@ -1450,13 +1980,13 @@ class FlutterEnhancedDocumentVerificationJobResult { Object encode() { return [ - actions.encode(), + actions, resultCode, resultText, resultType, smileJobId, - partnerParams.encode(), - antifraud?.encode(), + partnerParams, + antifraud, dob, photoBase64, gender, @@ -1479,15 +2009,13 @@ class FlutterEnhancedDocumentVerificationJobResult { static FlutterEnhancedDocumentVerificationJobResult decode(Object result) { result as List; return FlutterEnhancedDocumentVerificationJobResult( - actions: FlutterActions.decode(result[0]! as List), + actions: result[0]! as FlutterActions, resultCode: result[1]! as String, resultText: result[2]! as String, resultType: result[3]! as String, smileJobId: result[4]! as String, - partnerParams: FlutterPartnerParams.decode(result[5]! as List), - antifraud: result[6] != null - ? FlutterAntifraud.decode(result[6]! as List) - : null, + partnerParams: result[5]! as FlutterPartnerParams, + antifraud: result[6] as FlutterAntifraud?, dob: result[7] as String?, photoBase64: result[8] as String?, gender: result[9] as String?, @@ -1542,10 +2070,10 @@ class FlutterEnhancedDocumentVerificationJobStatusResponse { jobComplete, jobSuccess, code, - result?.encode(), + result, resultString, history, - imageLinks?.encode(), + imageLinks, ]; } @@ -1556,14 +2084,10 @@ class FlutterEnhancedDocumentVerificationJobStatusResponse { jobComplete: result[1]! as bool, jobSuccess: result[2]! as bool, code: result[3]! as String, - result: result[4] != null - ? FlutterEnhancedDocumentVerificationJobResult.decode(result[4]! as List) - : null, + result: result[4] as FlutterEnhancedDocumentVerificationJobResult?, resultString: result[5] as String?, history: (result[6] as List?)?.cast(), - imageLinks: result[7] != null - ? FlutterImageLinks.decode(result[7]! as List) - : null, + imageLinks: result[7] as FlutterImageLinks?, ); } } @@ -1612,7 +2136,7 @@ class FlutterProductsConfigResponse { Object encode() { return [ consentRequired, - idSelection.encode(), + idSelection, ]; } @@ -1620,7 +2144,7 @@ class FlutterProductsConfigResponse { result as List; return FlutterProductsConfigResponse( consentRequired: (result[0] as Map?)!.cast?>(), - idSelection: FlutterIdSelection.decode(result[1]! as List), + idSelection: result[1]! as FlutterIdSelection, ); } } @@ -1694,7 +2218,7 @@ class FlutterValidDocument { Object encode() { return [ - country.encode(), + country, idTypes, ]; } @@ -1702,7 +2226,7 @@ class FlutterValidDocument { static FlutterValidDocument decode(Object result) { result as List; return FlutterValidDocument( - country: FlutterCountry.decode(result[0]! as List), + country: result[0]! as FlutterCountry, idTypes: (result[1] as List?)!.cast(), ); } @@ -1788,7 +2312,7 @@ class FlutterServicesResponse { Object encode() { return [ bankCodes, - hostedWeb.encode(), + hostedWeb, ]; } @@ -1796,7 +2320,7 @@ class FlutterServicesResponse { result as List; return FlutterServicesResponse( bankCodes: (result[0] as List?)!.cast(), - hostedWeb: FlutterHostedWeb.decode(result[1]! as List), + hostedWeb: result[1]! as FlutterHostedWeb, ); } } @@ -1981,139 +2505,176 @@ class FlutterConfig { } } -class _SmileIDApiCodec extends StandardMessageCodec { - const _SmileIDApiCodec(); + +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is FlutterActions) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is FlutterAntifraud) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is FlutterJobType) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is FlutterAuthenticationRequest) { + writeValue(buffer, value.index); + } else if (value is FlutterJobTypeV2) { buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is FlutterAuthenticationResponse) { + writeValue(buffer, value.index); + } else if (value is FlutterImageType) { buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is FlutterAvailableIdType) { + writeValue(buffer, value.index); + } else if (value is FlutterActionResult) { buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is FlutterBankCode) { + writeValue(buffer, value.index); + } else if (value is FlutterSmartSelfieStatus) { buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else if (value is FlutterBiometricKycJobResult) { + writeValue(buffer, value.index); + } else if (value is FlutterPartnerParams) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is FlutterBiometricKycJobResult) { + } else if (value is SmartSelfieCreationParams) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is FlutterBiometricKycJobStatusResponse) { + } else if (value is SmartSelfieEnhancedCreationParams) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is FlutterConfig) { + } else if (value is SmartSelfieCaptureResult) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is FlutterConsentInfo) { + } else if (value is DocumentVerificationCreationParams) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is FlutterCountry) { + } else if (value is DocumentVerificationEnhancedCreationParams) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is FlutterCountryInfo) { + } else if (value is DocumentCaptureResult) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is FlutterDocumentVerificationJobResult) { + } else if (value is BiometricKYCCreationParams) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is FlutterDocumentVerificationJobResult) { + } else if (value is BiometricKYCCaptureResult) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is FlutterDocumentVerificationJobStatusResponse) { + } else if (value is SelfieCaptureViewCreationParams) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is FlutterEnhancedDocumentVerificationJobResult) { + } else if (value is DocumentCaptureCreationParams) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is FlutterEnhancedDocumentVerificationJobResult) { + } else if (value is FlutterAuthenticationRequest) { buffer.putUint8(145); writeValue(buffer, value.encode()); - } else if (value is FlutterEnhancedDocumentVerificationJobStatusResponse) { + } else if (value is FlutterAuthenticationResponse) { buffer.putUint8(146); writeValue(buffer, value.encode()); - } else if (value is FlutterEnhancedKycAsyncResponse) { + } else if (value is FlutterPrepUploadRequest) { buffer.putUint8(147); writeValue(buffer, value.encode()); - } else if (value is FlutterEnhancedKycRequest) { + } else if (value is FlutterPrepUploadResponse) { buffer.putUint8(148); writeValue(buffer, value.encode()); - } else if (value is FlutterEnhancedKycResponse) { + } else if (value is FlutterUploadRequest) { buffer.putUint8(149); writeValue(buffer, value.encode()); - } else if (value is FlutterHostedWeb) { + } else if (value is FlutterUploadImageInfo) { buffer.putUint8(150); writeValue(buffer, value.encode()); - } else if (value is FlutterIdInfo) { + } else if (value is FlutterIdInfo) { buffer.putUint8(151); writeValue(buffer, value.encode()); - } else if (value is FlutterIdSelection) { + } else if (value is FlutterEnhancedKycResponse) { buffer.putUint8(152); writeValue(buffer, value.encode()); - } else if (value is FlutterIdType) { + } else if (value is FlutterActions) { buffer.putUint8(153); writeValue(buffer, value.encode()); - } else if (value is FlutterImageLinks) { + } else if (value is FlutterConsentInfo) { buffer.putUint8(154); writeValue(buffer, value.encode()); - } else if (value is FlutterJobStatusRequest) { + } else if (value is FlutterEnhancedKycRequest) { buffer.putUint8(155); writeValue(buffer, value.encode()); - } else if (value is FlutterPartnerParams) { + } else if (value is FlutterEnhancedKycAsyncResponse) { buffer.putUint8(156); writeValue(buffer, value.encode()); - } else if (value is FlutterPrepUploadRequest) { + } else if (value is FlutterImageLinks) { buffer.putUint8(157); writeValue(buffer, value.encode()); - } else if (value is FlutterPrepUploadResponse) { + } else if (value is FlutterAntifraud) { buffer.putUint8(158); writeValue(buffer, value.encode()); - } else if (value is FlutterProductsConfigRequest) { + } else if (value is FlutterSuspectUser) { buffer.putUint8(159); writeValue(buffer, value.encode()); - } else if (value is FlutterProductsConfigResponse) { + } else if (value is FlutterJobStatusRequest) { buffer.putUint8(160); writeValue(buffer, value.encode()); - } else if (value is FlutterServicesResponse) { + } else if (value is FlutterSmartSelfieJobResult) { buffer.putUint8(161); writeValue(buffer, value.encode()); - } else if (value is FlutterSmartSelfieJobResult) { + } else if (value is FlutterSmartSelfieJobStatusResponse) { buffer.putUint8(162); writeValue(buffer, value.encode()); - } else if (value is FlutterSmartSelfieJobResult) { + } else if (value is FlutterSmartSelfieResponse) { buffer.putUint8(163); writeValue(buffer, value.encode()); - } else if (value is FlutterSmartSelfieJobStatusResponse) { + } else if (value is FlutterDocumentVerificationJobResult) { buffer.putUint8(164); writeValue(buffer, value.encode()); - } else if (value is FlutterSmartSelfieResponse) { + } else if (value is FlutterDocumentVerificationJobStatusResponse) { buffer.putUint8(165); writeValue(buffer, value.encode()); - } else if (value is FlutterSuspectUser) { + } else if (value is FlutterBiometricKycJobResult) { buffer.putUint8(166); writeValue(buffer, value.encode()); - } else if (value is FlutterUploadImageInfo) { + } else if (value is FlutterBiometricKycJobStatusResponse) { buffer.putUint8(167); writeValue(buffer, value.encode()); - } else if (value is FlutterUploadRequest) { + } else if (value is FlutterEnhancedDocumentVerificationJobResult) { buffer.putUint8(168); writeValue(buffer, value.encode()); - } else if (value is FlutterValidDocument) { + } else if (value is FlutterEnhancedDocumentVerificationJobStatusResponse) { buffer.putUint8(169); writeValue(buffer, value.encode()); - } else if (value is FlutterValidDocumentsResponse) { + } else if (value is FlutterProductsConfigRequest) { buffer.putUint8(170); writeValue(buffer, value.encode()); + } else if (value is FlutterProductsConfigResponse) { + buffer.putUint8(171); + writeValue(buffer, value.encode()); + } else if (value is FlutterIdSelection) { + buffer.putUint8(172); + writeValue(buffer, value.encode()); + } else if (value is FlutterValidDocumentsResponse) { + buffer.putUint8(173); + writeValue(buffer, value.encode()); + } else if (value is FlutterValidDocument) { + buffer.putUint8(174); + writeValue(buffer, value.encode()); + } else if (value is FlutterCountry) { + buffer.putUint8(175); + writeValue(buffer, value.encode()); + } else if (value is FlutterIdType) { + buffer.putUint8(176); + writeValue(buffer, value.encode()); + } else if (value is FlutterServicesResponse) { + buffer.putUint8(177); + writeValue(buffer, value.encode()); + } else if (value is FlutterBankCode) { + buffer.putUint8(178); + writeValue(buffer, value.encode()); + } else if (value is FlutterHostedWeb) { + buffer.putUint8(179); + writeValue(buffer, value.encode()); + } else if (value is FlutterCountryInfo) { + buffer.putUint8(180); + writeValue(buffer, value.encode()); + } else if (value is FlutterAvailableIdType) { + buffer.putUint8(181); + writeValue(buffer, value.encode()); + } else if (value is FlutterConfig) { + buffer.putUint8(182); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -2122,124 +2683,411 @@ class _SmileIDApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return FlutterActions.decode(readValue(buffer)!); case 129: - return FlutterAntifraud.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : FlutterJobType.values[value]; case 130: - return FlutterAuthenticationRequest.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : FlutterJobTypeV2.values[value]; case 131: - return FlutterAuthenticationResponse.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : FlutterImageType.values[value]; case 132: - return FlutterAvailableIdType.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : FlutterActionResult.values[value]; case 133: - return FlutterBankCode.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : FlutterSmartSelfieStatus.values[value]; case 134: - return FlutterBiometricKycJobResult.decode(readValue(buffer)!); + return FlutterPartnerParams.decode(readValue(buffer)!); case 135: - return FlutterBiometricKycJobResult.decode(readValue(buffer)!); + return SmartSelfieCreationParams.decode(readValue(buffer)!); case 136: - return FlutterBiometricKycJobStatusResponse.decode(readValue(buffer)!); + return SmartSelfieEnhancedCreationParams.decode(readValue(buffer)!); case 137: - return FlutterConfig.decode(readValue(buffer)!); + return SmartSelfieCaptureResult.decode(readValue(buffer)!); case 138: - return FlutterConsentInfo.decode(readValue(buffer)!); + return DocumentVerificationCreationParams.decode(readValue(buffer)!); case 139: - return FlutterCountry.decode(readValue(buffer)!); + return DocumentVerificationEnhancedCreationParams.decode(readValue(buffer)!); case 140: - return FlutterCountryInfo.decode(readValue(buffer)!); + return DocumentCaptureResult.decode(readValue(buffer)!); case 141: - return FlutterDocumentVerificationJobResult.decode(readValue(buffer)!); + return BiometricKYCCreationParams.decode(readValue(buffer)!); case 142: - return FlutterDocumentVerificationJobResult.decode(readValue(buffer)!); + return BiometricKYCCaptureResult.decode(readValue(buffer)!); case 143: - return FlutterDocumentVerificationJobStatusResponse.decode(readValue(buffer)!); + return SelfieCaptureViewCreationParams.decode(readValue(buffer)!); case 144: - return FlutterEnhancedDocumentVerificationJobResult.decode(readValue(buffer)!); + return DocumentCaptureCreationParams.decode(readValue(buffer)!); case 145: - return FlutterEnhancedDocumentVerificationJobResult.decode(readValue(buffer)!); + return FlutterAuthenticationRequest.decode(readValue(buffer)!); case 146: - return FlutterEnhancedDocumentVerificationJobStatusResponse.decode(readValue(buffer)!); + return FlutterAuthenticationResponse.decode(readValue(buffer)!); case 147: - return FlutterEnhancedKycAsyncResponse.decode(readValue(buffer)!); + return FlutterPrepUploadRequest.decode(readValue(buffer)!); case 148: - return FlutterEnhancedKycRequest.decode(readValue(buffer)!); + return FlutterPrepUploadResponse.decode(readValue(buffer)!); case 149: - return FlutterEnhancedKycResponse.decode(readValue(buffer)!); + return FlutterUploadRequest.decode(readValue(buffer)!); case 150: - return FlutterHostedWeb.decode(readValue(buffer)!); + return FlutterUploadImageInfo.decode(readValue(buffer)!); case 151: return FlutterIdInfo.decode(readValue(buffer)!); case 152: - return FlutterIdSelection.decode(readValue(buffer)!); + return FlutterEnhancedKycResponse.decode(readValue(buffer)!); case 153: - return FlutterIdType.decode(readValue(buffer)!); + return FlutterActions.decode(readValue(buffer)!); case 154: - return FlutterImageLinks.decode(readValue(buffer)!); + return FlutterConsentInfo.decode(readValue(buffer)!); case 155: - return FlutterJobStatusRequest.decode(readValue(buffer)!); + return FlutterEnhancedKycRequest.decode(readValue(buffer)!); case 156: - return FlutterPartnerParams.decode(readValue(buffer)!); + return FlutterEnhancedKycAsyncResponse.decode(readValue(buffer)!); case 157: - return FlutterPrepUploadRequest.decode(readValue(buffer)!); + return FlutterImageLinks.decode(readValue(buffer)!); case 158: - return FlutterPrepUploadResponse.decode(readValue(buffer)!); + return FlutterAntifraud.decode(readValue(buffer)!); case 159: - return FlutterProductsConfigRequest.decode(readValue(buffer)!); + return FlutterSuspectUser.decode(readValue(buffer)!); case 160: - return FlutterProductsConfigResponse.decode(readValue(buffer)!); + return FlutterJobStatusRequest.decode(readValue(buffer)!); case 161: - return FlutterServicesResponse.decode(readValue(buffer)!); - case 162: return FlutterSmartSelfieJobResult.decode(readValue(buffer)!); + case 162: + return FlutterSmartSelfieJobStatusResponse.decode(readValue(buffer)!); case 163: - return FlutterSmartSelfieJobResult.decode(readValue(buffer)!); + return FlutterSmartSelfieResponse.decode(readValue(buffer)!); case 164: - return FlutterSmartSelfieJobStatusResponse.decode(readValue(buffer)!); + return FlutterDocumentVerificationJobResult.decode(readValue(buffer)!); case 165: - return FlutterSmartSelfieResponse.decode(readValue(buffer)!); + return FlutterDocumentVerificationJobStatusResponse.decode(readValue(buffer)!); case 166: - return FlutterSuspectUser.decode(readValue(buffer)!); + return FlutterBiometricKycJobResult.decode(readValue(buffer)!); case 167: - return FlutterUploadImageInfo.decode(readValue(buffer)!); + return FlutterBiometricKycJobStatusResponse.decode(readValue(buffer)!); case 168: - return FlutterUploadRequest.decode(readValue(buffer)!); + return FlutterEnhancedDocumentVerificationJobResult.decode(readValue(buffer)!); case 169: - return FlutterValidDocument.decode(readValue(buffer)!); + return FlutterEnhancedDocumentVerificationJobStatusResponse.decode(readValue(buffer)!); case 170: + return FlutterProductsConfigRequest.decode(readValue(buffer)!); + case 171: + return FlutterProductsConfigResponse.decode(readValue(buffer)!); + case 172: + return FlutterIdSelection.decode(readValue(buffer)!); + case 173: return FlutterValidDocumentsResponse.decode(readValue(buffer)!); + case 174: + return FlutterValidDocument.decode(readValue(buffer)!); + case 175: + return FlutterCountry.decode(readValue(buffer)!); + case 176: + return FlutterIdType.decode(readValue(buffer)!); + case 177: + return FlutterServicesResponse.decode(readValue(buffer)!); + case 178: + return FlutterBankCode.decode(readValue(buffer)!); + case 179: + return FlutterHostedWeb.decode(readValue(buffer)!); + case 180: + return FlutterCountryInfo.decode(readValue(buffer)!); + case 181: + return FlutterAvailableIdType.decode(readValue(buffer)!); + case 182: + return FlutterConfig.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } } } +class SmileIDProductsApi { + /// Constructor for [SmileIDProductsApi]. The [binaryMessenger] named argument is + /// available for dependency injection. If it is left null, the default + /// BinaryMessenger will be used which routes to the host platform. + SmileIDProductsApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String pigeonVar_messageChannelSuffix; + + Future documentVerification(DocumentVerificationCreationParams creationParams) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDProductsApi.documentVerification$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([creationParams]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as DocumentCaptureResult?)!; + } + } + + Future documentVerificationEnhanced(DocumentVerificationEnhancedCreationParams creationParams) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDProductsApi.documentVerificationEnhanced$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([creationParams]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as DocumentCaptureResult?)!; + } + } + + Future smartSelfieEnrollment(SmartSelfieCreationParams creationParams) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieEnrollment$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([creationParams]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as SmartSelfieCaptureResult?)!; + } + } + + Future smartSelfieAuthentication(SmartSelfieCreationParams creationParams) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieAuthentication$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([creationParams]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as SmartSelfieCaptureResult?)!; + } + } + + Future smartSelfieEnrollmentEnhanced(SmartSelfieEnhancedCreationParams creationParams) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieEnrollmentEnhanced$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([creationParams]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as SmartSelfieCaptureResult?)!; + } + } + + Future smartSelfieAuthenticationEnhanced(SmartSelfieEnhancedCreationParams creationParams) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDProductsApi.smartSelfieAuthenticationEnhanced$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([creationParams]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as SmartSelfieCaptureResult?)!; + } + } + + Future biometricKYC(BiometricKYCCreationParams creationParams) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDProductsApi.biometricKYC$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([creationParams]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as BiometricKYCCaptureResult?)!; + } + } + + Future selfieCapture(SelfieCaptureViewCreationParams creationParams) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDProductsApi.selfieCapture$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([creationParams]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as SmartSelfieCaptureResult?)!; + } + } + + Future documentCapture(DocumentCaptureCreationParams creationParams) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDProductsApi.documentCapture$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([creationParams]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as DocumentCaptureResult?)!; + } + } +} + class SmileIDApi { /// Constructor for [SmileIDApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - SmileIDApi({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; - final BinaryMessenger? __pigeon_binaryMessenger; + SmileIDApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - static const MessageCodec pigeonChannelCodec = _SmileIDApiCodec(); + final String pigeonVar_messageChannelSuffix; Future initializeWithApiKey(String apiKey, FlutterConfig config, bool useSandbox, bool enableCrashReporting) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.initializeWithApiKey'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.initializeWithApiKey$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([apiKey, config, useSandbox, enableCrashReporting]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([apiKey, config, useSandbox, enableCrashReporting]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2247,21 +3095,21 @@ class SmileIDApi { } Future initializeWithConfig(FlutterConfig config, bool useSandbox, bool enableCrashReporting) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.initializeWithConfig'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.initializeWithConfig$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([config, useSandbox, enableCrashReporting]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([config, useSandbox, enableCrashReporting]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2269,21 +3117,21 @@ class SmileIDApi { } Future initialize(bool useSandbox) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.initialize'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.initialize$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([useSandbox]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([useSandbox]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2291,21 +3139,21 @@ class SmileIDApi { } Future setCallbackUrl(String callbackUrl) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.setCallbackUrl'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.setCallbackUrl$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([callbackUrl]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([callbackUrl]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2313,119 +3161,119 @@ class SmileIDApi { } Future setAllowOfflineMode(bool allowOfflineMode) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.setAllowOfflineMode'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.setAllowOfflineMode$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([allowOfflineMode]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([allowOfflineMode]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future> getSubmittedJobs() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getSubmittedJobs'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + Future> getSubmittedJobs() async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getSubmittedJobs$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } - Future> getUnsubmittedJobs() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getUnsubmittedJobs'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + Future> getUnsubmittedJobs() async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getUnsubmittedJobs$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } Future cleanup(String jobId) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.cleanup'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.cleanup$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([jobId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([jobId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future cleanupJobs(List jobIds) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.cleanupJobs'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + Future cleanupJobs(List jobIds) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.cleanupJobs$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([jobIds]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([jobIds]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2433,21 +3281,21 @@ class SmileIDApi { } Future submitJob(String jobId, bool deleteFilesOnSuccess) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.submitJob'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.submitJob$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([jobId, deleteFilesOnSuccess]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([jobId, deleteFilesOnSuccess]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2455,75 +3303,75 @@ class SmileIDApi { } Future authenticate(FlutterAuthenticationRequest request) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.authenticate'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.authenticate$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterAuthenticationResponse?)!; + return (pigeonVar_replyList[0] as FlutterAuthenticationResponse?)!; } } Future prepUpload(FlutterPrepUploadRequest request) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.prepUpload'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.prepUpload$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterPrepUploadResponse?)!; + return (pigeonVar_replyList[0] as FlutterPrepUploadResponse?)!; } } Future upload(String url, FlutterUploadRequest request) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.upload'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.upload$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([url, request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([url, request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2531,407 +3379,407 @@ class SmileIDApi { } Future doEnhancedKyc(FlutterEnhancedKycRequest request) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKyc'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKyc$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterEnhancedKycResponse?)!; + return (pigeonVar_replyList[0] as FlutterEnhancedKycResponse?)!; } } Future doEnhancedKycAsync(FlutterEnhancedKycRequest request) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKycAsync'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.doEnhancedKycAsync$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterEnhancedKycAsyncResponse?)!; + return (pigeonVar_replyList[0] as FlutterEnhancedKycAsyncResponse?)!; } } Future getSmartSelfieJobStatus(FlutterJobStatusRequest request) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getSmartSelfieJobStatus'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getSmartSelfieJobStatus$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterSmartSelfieJobStatusResponse?)!; + return (pigeonVar_replyList[0] as FlutterSmartSelfieJobStatusResponse?)!; } } - Future doSmartSelfieEnrollment(String signature, String timestamp, String selfieImage, List livenessImages, String userId, Map? partnerParams, String? callbackUrl, int? sandboxResult, bool? allowNewEnroll) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieEnrollment'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + Future doSmartSelfieEnrollment(String signature, String timestamp, String selfieImage, List livenessImages, String userId, Map? partnerParams, String? callbackUrl, int? sandboxResult, bool? allowNewEnroll) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieEnrollment$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([signature, timestamp, selfieImage, livenessImages, userId, partnerParams, callbackUrl, sandboxResult, allowNewEnroll]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([signature, timestamp, selfieImage, livenessImages, userId, partnerParams, callbackUrl, sandboxResult, allowNewEnroll]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterSmartSelfieResponse?)!; + return (pigeonVar_replyList[0] as FlutterSmartSelfieResponse?)!; } } - Future doSmartSelfieAuthentication(String signature, String timestamp, String selfieImage, List livenessImages, String userId, Map? partnerParams, String? callbackUrl, int? sandboxResult) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieAuthentication'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + Future doSmartSelfieAuthentication(String signature, String timestamp, String selfieImage, List livenessImages, String userId, Map? partnerParams, String? callbackUrl, int? sandboxResult) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.doSmartSelfieAuthentication$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([signature, timestamp, selfieImage, livenessImages, userId, partnerParams, callbackUrl, sandboxResult]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([signature, timestamp, selfieImage, livenessImages, userId, partnerParams, callbackUrl, sandboxResult]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterSmartSelfieResponse?)!; + return (pigeonVar_replyList[0] as FlutterSmartSelfieResponse?)!; } } Future getDocumentVerificationJobStatus(FlutterJobStatusRequest request) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getDocumentVerificationJobStatus'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getDocumentVerificationJobStatus$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterDocumentVerificationJobStatusResponse?)!; + return (pigeonVar_replyList[0] as FlutterDocumentVerificationJobStatusResponse?)!; } } Future getBiometricKycJobStatus(FlutterJobStatusRequest request) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getBiometricKycJobStatus'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getBiometricKycJobStatus$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterBiometricKycJobStatusResponse?)!; + return (pigeonVar_replyList[0] as FlutterBiometricKycJobStatusResponse?)!; } } Future getEnhancedDocumentVerificationJobStatus(FlutterJobStatusRequest request) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getEnhancedDocumentVerificationJobStatus'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getEnhancedDocumentVerificationJobStatus$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterEnhancedDocumentVerificationJobStatusResponse?)!; + return (pigeonVar_replyList[0] as FlutterEnhancedDocumentVerificationJobStatusResponse?)!; } } Future getProductsConfig(FlutterProductsConfigRequest request) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getProductsConfig'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getProductsConfig$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterProductsConfigResponse?)!; + return (pigeonVar_replyList[0] as FlutterProductsConfigResponse?)!; } } Future getValidDocuments(FlutterProductsConfigRequest request) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getValidDocuments'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getValidDocuments$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterValidDocumentsResponse?)!; + return (pigeonVar_replyList[0] as FlutterValidDocumentsResponse?)!; } } Future getServices() async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getServices'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.getServices$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterServicesResponse?)!; + return (pigeonVar_replyList[0] as FlutterServicesResponse?)!; } } Future pollSmartSelfieJobStatus(FlutterJobStatusRequest request, int interval, int numAttempts) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.pollSmartSelfieJobStatus'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.pollSmartSelfieJobStatus$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request, interval, numAttempts]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request, interval, numAttempts]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterSmartSelfieJobStatusResponse?)!; + return (pigeonVar_replyList[0] as FlutterSmartSelfieJobStatusResponse?)!; } } Future pollDocumentVerificationJobStatus(FlutterJobStatusRequest request, int interval, int numAttempts) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.pollDocumentVerificationJobStatus'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.pollDocumentVerificationJobStatus$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request, interval, numAttempts]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request, interval, numAttempts]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterDocumentVerificationJobStatusResponse?)!; + return (pigeonVar_replyList[0] as FlutterDocumentVerificationJobStatusResponse?)!; } } Future pollBiometricKycJobStatus(FlutterJobStatusRequest request, int interval, int numAttempts) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.pollBiometricKycJobStatus'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.pollBiometricKycJobStatus$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request, interval, numAttempts]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request, interval, numAttempts]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterBiometricKycJobStatusResponse?)!; + return (pigeonVar_replyList[0] as FlutterBiometricKycJobStatusResponse?)!; } } Future pollEnhancedDocumentVerificationJobStatus(FlutterJobStatusRequest request, int interval, int numAttempts) async { - const String __pigeon_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.pollEnhancedDocumentVerificationJobStatus'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.smileid.SmileIDApi.pollEnhancedDocumentVerificationJobStatus$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([request, interval, numAttempts]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([request, interval, numAttempts]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FlutterEnhancedDocumentVerificationJobStatusResponse?)!; + return (pigeonVar_replyList[0] as FlutterEnhancedDocumentVerificationJobStatusResponse?)!; } } } diff --git a/pigeon/messages.dart b/pigeon/messages.dart index b23cfd6c..c315124e 100644 --- a/pigeon/messages.dart +++ b/pigeon/messages.dart @@ -3,14 +3,12 @@ import 'package:pigeon/pigeon.dart'; @ConfigurePigeon(PigeonOptions( dartOut: 'lib/smileid_messages.g.dart', dartOptions: DartOptions(), - kotlinOut: - 'android/src/main/kotlin/com/smileidentity/flutter/generated/SmileIDMessages.g.kt', + kotlinOut: 'android/src/main/kotlin/com/smileidentity/flutter/generated/SmileIDMessages.g.kt', kotlinOptions: KotlinOptions(errorClassName: "SmileFlutterError"), swiftOut: 'ios/Classes/SmileIDMessages.g.swift', swiftOptions: SwiftOptions(), dartPackageName: 'smileid', )) - enum FlutterJobType { enhancedKyc, documentVerification, @@ -32,6 +30,222 @@ class FlutterPartnerParams { FlutterPartnerParams(this.jobType, this.jobId, this.userId); } +class SmartSelfieCreationParams { + final String? userId; + final bool allowNewEnroll; + final bool allowAgentMode; + final bool showAttribution; + final bool showInstructions; + final bool skipApiSubmission; + final Map? extraPartnerParams; + + SmartSelfieCreationParams({ + this.userId, + this.allowNewEnroll = false, + this.allowAgentMode = false, + this.showAttribution = true, + this.showInstructions = true, + this.skipApiSubmission = false, + this.extraPartnerParams, + }); +} + +class SmartSelfieEnhancedCreationParams { + final String? userId; + final bool allowNewEnroll; + final bool showAttribution; + final bool showInstructions; + final Map? extraPartnerParams; + + SmartSelfieEnhancedCreationParams({ + this.userId, + this.allowNewEnroll = false, + this.showAttribution = true, + this.showInstructions = true, + this.extraPartnerParams, + }); +} + +class SmartSelfieCaptureResult { + final String? selfieFile; + final List? livenessFiles; + final Map? apiResponse; + + SmartSelfieCaptureResult({ + this.selfieFile, + this.livenessFiles, + this.apiResponse, + }); +} + +class DocumentVerificationCreationParams { + final String countryCode; + final String? documentType; + final double? idAspectRatio; + final bool captureBothSides; + final String? bypassSelfieCaptureWithFile; + final String? userId; + final String? jobId; + final bool allowNewEnroll; + final bool showAttribution; + final bool allowGalleryUpload; + final bool allowAgentMode; + final bool showInstructions; + final bool skipApiSubmission; + final Map? extraPartnerParams; + + const DocumentVerificationCreationParams({ + required this.countryCode, + this.documentType, + this.idAspectRatio, + this.captureBothSides = true, + this.bypassSelfieCaptureWithFile, + this.userId, + this.jobId, + this.allowNewEnroll = false, + this.showAttribution = true, + this.allowGalleryUpload = false, + this.allowAgentMode = false, + this.showInstructions = true, + this.skipApiSubmission = false, + this.extraPartnerParams, + }); +} + +class DocumentVerificationEnhancedCreationParams { + final String countryCode; + final String? documentType; + final double? idAspectRatio; + final bool captureBothSides; + final String? bypassSelfieCaptureWithFile; + final String? userId; + final String? jobId; + final bool allowNewEnroll; + final bool showAttribution; + final bool allowAgentMode; + final bool allowGalleryUpload; + final bool showInstructions; + final bool skipApiSubmission; + final Map? extraPartnerParams; + + const DocumentVerificationEnhancedCreationParams({ + required this.countryCode, + this.documentType, + this.idAspectRatio, + this.captureBothSides = true, + this.bypassSelfieCaptureWithFile, + this.userId, + this.jobId, + this.allowNewEnroll = false, + this.showAttribution = true, + this.allowAgentMode = false, + this.allowGalleryUpload = false, + this.showInstructions = true, + this.skipApiSubmission = false, + this.extraPartnerParams, + }); +} + +class DocumentCaptureResult { + final String? selfieFile; + final String? documentFrontFile; + final List? livenessFiles; + final String? documentBackFile; + final bool? didSubmitDocumentVerificationJob; + final bool? didSubmitEnhancedDocVJob; + + const DocumentCaptureResult({ + this.selfieFile, + this.documentFrontFile, + this.livenessFiles, + this.documentBackFile, + this.didSubmitDocumentVerificationJob, + this.didSubmitEnhancedDocVJob, + }); +} + +class BiometricKYCCreationParams { + final String? country; + final String? idType; + final String? idNumber; + final String? firstName; + final String? middleName; + final String? lastName; + final String? dob; + final String? bankCode; + final bool? entered; + final String? userId; + final String? jobId; + final bool allowNewEnroll; + final bool allowAgentMode; + final bool showAttribution; + final bool showInstructions; + final Map? extraPartnerParams; + + const BiometricKYCCreationParams({ + this.country, + this.idType, + this.idNumber, + this.firstName, + this.middleName, + this.lastName, + this.dob, + this.bankCode, + this.entered, + this.userId, + this.jobId, + this.allowNewEnroll = false, + this.allowAgentMode = false, + this.showAttribution = true, + this.showInstructions = true, + this.extraPartnerParams, + }); +} + +class BiometricKYCCaptureResult { + final String? selfieFile; + final List? livenessFiles; + final bool? didSubmitBiometricKycJob; + + const BiometricKYCCaptureResult({ + this.selfieFile, + this.livenessFiles, + this.didSubmitBiometricKycJob, + }); +} + +class SelfieCaptureViewCreationParams { + final bool showConfirmationDialog; + final bool showInstructions; + final bool showAttribution; + final bool allowAgentMode; + + const SelfieCaptureViewCreationParams({ + this.showConfirmationDialog = true, + this.showInstructions = true, + this.showAttribution = true, + this.allowAgentMode = true, + }); +} + +class DocumentCaptureCreationParams { + final bool isDocumentFrontSide; + final bool showInstructions; + final bool showAttribution; + final bool allowGalleryUpload; + final bool showConfirmationDialog; + final double? idAspectRatio; + + const DocumentCaptureCreationParams({ + this.isDocumentFrontSide = true, + this.showInstructions = true, + this.showAttribution = true, + this.allowGalleryUpload = true, + this.showConfirmationDialog = true, + this.idAspectRatio, + }); +} + /// The Auth Smile request. Auth Smile serves multiple purposes: /// /// - It is used to fetch the signature needed for subsequent API requests @@ -297,20 +511,21 @@ class FlutterEnhancedKycRequest { final String timestamp; final String signature; - FlutterEnhancedKycRequest( - {required this.country, - required this.idType, - required this.idNumber, - this.firstName, - this.middleName, - this.lastName, - this.dob, - this.phoneNumber, - this.bankCode, - this.callbackUrl, - required this.partnerParams, - required this.timestamp, - required this.signature}); + FlutterEnhancedKycRequest({ + required this.country, + required this.idType, + required this.idNumber, + this.firstName, + this.middleName, + this.lastName, + this.dob, + this.phoneNumber, + this.bankCode, + this.callbackUrl, + required this.partnerParams, + required this.timestamp, + required this.signature, + }); } class FlutterEnhancedKycAsyncResponse { @@ -801,24 +1016,66 @@ class FlutterConfig { }); } +@HostApi() +abstract class SmileIDProductsApi { + @async + DocumentCaptureResult documentVerification( + DocumentVerificationCreationParams creationParams, + ); + + @async + DocumentCaptureResult documentVerificationEnhanced( + DocumentVerificationEnhancedCreationParams creationParams, + ); + + @async + SmartSelfieCaptureResult smartSelfieEnrollment( + SmartSelfieCreationParams creationParams, + ); + + @async + SmartSelfieCaptureResult smartSelfieAuthentication( + SmartSelfieCreationParams creationParams, + ); + + @async + SmartSelfieCaptureResult smartSelfieEnrollmentEnhanced( + SmartSelfieEnhancedCreationParams creationParams, + ); + + @async + SmartSelfieCaptureResult smartSelfieAuthenticationEnhanced( + SmartSelfieEnhancedCreationParams creationParams, + ); + + @async + BiometricKYCCaptureResult biometricKYC( + BiometricKYCCreationParams creationParams, + ); + + @async + SmartSelfieCaptureResult selfieCapture(SelfieCaptureViewCreationParams creationParams); + + @async + DocumentCaptureResult documentCapture(DocumentCaptureCreationParams creationParams); +} + @HostApi() abstract class SmileIDApi { void initializeWithApiKey( - String apiKey, - FlutterConfig config, - bool useSandbox, - bool enableCrashReporting + String apiKey, + FlutterConfig config, + bool useSandbox, + bool enableCrashReporting, ); void initializeWithConfig( - FlutterConfig config, - bool useSandbox, - bool enableCrashReporting + FlutterConfig config, + bool useSandbox, + bool enableCrashReporting, ); - void initialize( - bool useSandbox - ); + void initialize(bool useSandbox); void setCallbackUrl(String callbackUrl); @@ -835,8 +1092,7 @@ abstract class SmileIDApi { void submitJob(String jobId, bool deleteFilesOnSuccess); @async - FlutterAuthenticationResponse authenticate( - FlutterAuthenticationRequest request); + FlutterAuthenticationResponse authenticate(FlutterAuthenticationRequest request); @async FlutterPrepUploadResponse prepUpload(FlutterPrepUploadRequest request); @@ -848,12 +1104,10 @@ abstract class SmileIDApi { FlutterEnhancedKycResponse doEnhancedKyc(FlutterEnhancedKycRequest request); @async - FlutterEnhancedKycAsyncResponse doEnhancedKycAsync( - FlutterEnhancedKycRequest request); + FlutterEnhancedKycAsyncResponse doEnhancedKycAsync(FlutterEnhancedKycRequest request); @async - FlutterSmartSelfieJobStatusResponse getSmartSelfieJobStatus( - FlutterJobStatusRequest request); + FlutterSmartSelfieJobStatusResponse getSmartSelfieJobStatus(FlutterJobStatusRequest request); @async FlutterSmartSelfieResponse doSmartSelfieEnrollment( @@ -882,40 +1136,51 @@ abstract class SmileIDApi { @async FlutterDocumentVerificationJobStatusResponse getDocumentVerificationJobStatus( - FlutterJobStatusRequest request); + FlutterJobStatusRequest request, + ); @async - FlutterBiometricKycJobStatusResponse getBiometricKycJobStatus( - FlutterJobStatusRequest request); + FlutterBiometricKycJobStatusResponse getBiometricKycJobStatus(FlutterJobStatusRequest request); @async FlutterEnhancedDocumentVerificationJobStatusResponse getEnhancedDocumentVerificationJobStatus( - FlutterJobStatusRequest request); + FlutterJobStatusRequest request, + ); @async - FlutterProductsConfigResponse getProductsConfig( - FlutterProductsConfigRequest request); + FlutterProductsConfigResponse getProductsConfig(FlutterProductsConfigRequest request); @async - FlutterValidDocumentsResponse getValidDocuments( - FlutterProductsConfigRequest request); + FlutterValidDocumentsResponse getValidDocuments(FlutterProductsConfigRequest request); @async FlutterServicesResponse getServices(); @async FlutterSmartSelfieJobStatusResponse pollSmartSelfieJobStatus( - FlutterJobStatusRequest request, int interval, int numAttempts); + FlutterJobStatusRequest request, + int interval, + int numAttempts, + ); @async FlutterDocumentVerificationJobStatusResponse pollDocumentVerificationJobStatus( - FlutterJobStatusRequest request, int interval, int numAttempts); + FlutterJobStatusRequest request, + int interval, + int numAttempts, + ); @async FlutterBiometricKycJobStatusResponse pollBiometricKycJobStatus( - FlutterJobStatusRequest request, int interval, int numAttempts); + FlutterJobStatusRequest request, + int interval, + int numAttempts, + ); @async FlutterEnhancedDocumentVerificationJobStatusResponse pollEnhancedDocumentVerificationJobStatus( - FlutterJobStatusRequest request, int interval, int numAttempts); + FlutterJobStatusRequest request, + int interval, + int numAttempts, + ); } diff --git a/pubspec.yaml b/pubspec.yaml index f82e1422..3dc08d86 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,6 +2,8 @@ name: smile_id description: The Official Smile ID Flutter SDK version: 10.3.3 homepage: "https://usesmileid.com" +repository: https://github.com/smileidentity/flutter +issue_tracker: https://github.com/smileidentity/flutter/issues environment: sdk: '>=3.0.5 <4.0.0' @@ -10,7 +12,7 @@ environment: dependencies: flutter: sdk: flutter - plugin_platform_interface: ^2.0.2 + plugin_platform_interface: ^2.1.8 dev_dependencies: build_runner: ^2.4.6 @@ -18,7 +20,7 @@ dev_dependencies: sdk: flutter flutter_lints: ">=2.0.3 <4.0.0" mockito: ^5.4.2 - pigeon: ">=10.1.6 <17.0.0" + pigeon: ">=17.0.0 <=22.7.2" flutter: plugin: diff --git a/test/smile_id_test.mocks.dart b/test/smile_id_test.mocks.dart index 001668a6..bfe88121 100644 --- a/test/smile_id_test.mocks.dart +++ b/test/smile_id_test.mocks.dart @@ -110,8 +110,7 @@ class _FakeFlutterBiometricKycJobStatusResponse_7 extends _i1.SmartFake ); } -class _FakeFlutterEnhancedDocumentVerificationJobStatusResponse_8 - extends _i1.SmartFake +class _FakeFlutterEnhancedDocumentVerificationJobStatusResponse_8 extends _i1.SmartFake implements _i2.FlutterEnhancedDocumentVerificationJobStatusResponse { _FakeFlutterEnhancedDocumentVerificationJobStatusResponse_8( Object parent, @@ -144,8 +143,7 @@ class _FakeFlutterValidDocumentsResponse_10 extends _i1.SmartFake ); } -class _FakeFlutterServicesResponse_11 extends _i1.SmartFake - implements _i2.FlutterServicesResponse { +class _FakeFlutterServicesResponse_11 extends _i1.SmartFake implements _i2.FlutterServicesResponse { _FakeFlutterServicesResponse_11( Object parent, Invocation parentInvocation, @@ -165,8 +163,7 @@ class _FakeObject_12 extends _i1.SmartFake implements Object { ); } -class _FakeFlutterPartnerParams_13 extends _i1.SmartFake - implements _i2.FlutterPartnerParams { +class _FakeFlutterPartnerParams_13 extends _i1.SmartFake implements _i2.FlutterPartnerParams { _FakeFlutterPartnerParams_13( Object parent, Invocation parentInvocation, @@ -241,8 +238,7 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ) as _i3.Future); @override - _i3.Future setAllowOfflineMode(bool? allowOfflineMode) => - (super.noSuchMethod( + _i3.Future setAllowOfflineMode(bool? allowOfflineMode) => (super.noSuchMethod( Invocation.method( #setAllowOfflineMode, [allowOfflineMode], @@ -252,24 +248,24 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ) as _i3.Future); @override - _i3.Future> getSubmittedJobs() => (super.noSuchMethod( + _i3.Future> getSubmittedJobs() => (super.noSuchMethod( Invocation.method( #getSubmittedJobs, [], ), - returnValue: _i3.Future>.value([]), - returnValueForMissingStub: _i3.Future>.value([]), - ) as _i3.Future>); + returnValue: _i3.Future>.value([]), + returnValueForMissingStub: _i3.Future>.value([]), + ) as _i3.Future>); @override - _i3.Future> getUnsubmittedJobs() => (super.noSuchMethod( + _i3.Future> getUnsubmittedJobs() => (super.noSuchMethod( Invocation.method( #getUnsubmittedJobs, [], ), - returnValue: _i3.Future>.value([]), - returnValueForMissingStub: _i3.Future>.value([]), - ) as _i3.Future>); + returnValue: _i3.Future>.value([]), + returnValueForMissingStub: _i3.Future>.value([]), + ) as _i3.Future>); @override _i3.Future cleanup(String? jobId) => (super.noSuchMethod( @@ -324,9 +320,8 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { [request], ), )), - returnValueForMissingStub: - _i3.Future<_i2.FlutterAuthenticationResponse>.value( - _FakeFlutterAuthenticationResponse_0( + returnValueForMissingStub: _i3.Future<_i2.FlutterAuthenticationResponse>.value( + _FakeFlutterAuthenticationResponse_0( this, Invocation.method( #authenticate, @@ -336,15 +331,14 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ) as _i3.Future<_i2.FlutterAuthenticationResponse>); @override - _i3.Future<_i2.FlutterPrepUploadResponse> prepUpload( - _i2.FlutterPrepUploadRequest? request) => + _i3.Future<_i2.FlutterPrepUploadResponse> prepUpload(_i2.FlutterPrepUploadRequest? request) => (super.noSuchMethod( Invocation.method( #prepUpload, [request], ), - returnValue: _i3.Future<_i2.FlutterPrepUploadResponse>.value( - _FakeFlutterPrepUploadResponse_1( + returnValue: + _i3.Future<_i2.FlutterPrepUploadResponse>.value(_FakeFlutterPrepUploadResponse_1( this, Invocation.method( #prepUpload, @@ -352,8 +346,7 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.FlutterPrepUploadResponse>.value( - _FakeFlutterPrepUploadResponse_1( + _i3.Future<_i2.FlutterPrepUploadResponse>.value(_FakeFlutterPrepUploadResponse_1( this, Invocation.method( #prepUpload, @@ -387,8 +380,8 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { #doEnhancedKyc, [request], ), - returnValue: _i3.Future<_i2.FlutterEnhancedKycResponse>.value( - _FakeFlutterEnhancedKycResponse_2( + returnValue: + _i3.Future<_i2.FlutterEnhancedKycResponse>.value(_FakeFlutterEnhancedKycResponse_2( this, Invocation.method( #doEnhancedKyc, @@ -396,8 +389,7 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.FlutterEnhancedKycResponse>.value( - _FakeFlutterEnhancedKycResponse_2( + _i3.Future<_i2.FlutterEnhancedKycResponse>.value(_FakeFlutterEnhancedKycResponse_2( this, Invocation.method( #doEnhancedKyc, @@ -422,9 +414,8 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { [request], ), )), - returnValueForMissingStub: - _i3.Future<_i2.FlutterEnhancedKycAsyncResponse>.value( - _FakeFlutterEnhancedKycAsyncResponse_3( + returnValueForMissingStub: _i3.Future<_i2.FlutterEnhancedKycAsyncResponse>.value( + _FakeFlutterEnhancedKycAsyncResponse_3( this, Invocation.method( #doEnhancedKycAsync, @@ -449,9 +440,8 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { [request], ), )), - returnValueForMissingStub: - _i3.Future<_i2.FlutterSmartSelfieJobStatusResponse>.value( - _FakeFlutterSmartSelfieJobStatusResponse_4( + returnValueForMissingStub: _i3.Future<_i2.FlutterSmartSelfieJobStatusResponse>.value( + _FakeFlutterSmartSelfieJobStatusResponse_4( this, Invocation.method( #getSmartSelfieJobStatus, @@ -487,8 +477,8 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { allowNewEnroll, ], ), - returnValue: _i3.Future<_i2.FlutterSmartSelfieResponse>.value( - _FakeFlutterSmartSelfieResponse_5( + returnValue: + _i3.Future<_i2.FlutterSmartSelfieResponse>.value(_FakeFlutterSmartSelfieResponse_5( this, Invocation.method( #doSmartSelfieEnrollment, @@ -506,8 +496,7 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.FlutterSmartSelfieResponse>.value( - _FakeFlutterSmartSelfieResponse_5( + _i3.Future<_i2.FlutterSmartSelfieResponse>.value(_FakeFlutterSmartSelfieResponse_5( this, Invocation.method( #doSmartSelfieEnrollment, @@ -551,8 +540,8 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { sandboxResult, ], ), - returnValue: _i3.Future<_i2.FlutterSmartSelfieResponse>.value( - _FakeFlutterSmartSelfieResponse_5( + returnValue: + _i3.Future<_i2.FlutterSmartSelfieResponse>.value(_FakeFlutterSmartSelfieResponse_5( this, Invocation.method( #doSmartSelfieAuthentication, @@ -569,8 +558,7 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.FlutterSmartSelfieResponse>.value( - _FakeFlutterSmartSelfieResponse_5( + _i3.Future<_i2.FlutterSmartSelfieResponse>.value(_FakeFlutterSmartSelfieResponse_5( this, Invocation.method( #doSmartSelfieAuthentication, @@ -589,32 +577,31 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ) as _i3.Future<_i2.FlutterSmartSelfieResponse>); @override - _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse> - getDocumentVerificationJobStatus(_i2.FlutterJobStatusRequest? request) => - (super.noSuchMethod( - Invocation.method( - #getDocumentVerificationJobStatus, - [request], - ), - returnValue: _i3 - .Future<_i2.FlutterDocumentVerificationJobStatusResponse>.value( - _FakeFlutterDocumentVerificationJobStatusResponse_6( - this, - Invocation.method( - #getDocumentVerificationJobStatus, - [request], - ), - )), - returnValueForMissingStub: _i3 - .Future<_i2.FlutterDocumentVerificationJobStatusResponse>.value( + _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse> getDocumentVerificationJobStatus( + _i2.FlutterJobStatusRequest? request) => + (super.noSuchMethod( + Invocation.method( + #getDocumentVerificationJobStatus, + [request], + ), + returnValue: _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse>.value( + _FakeFlutterDocumentVerificationJobStatusResponse_6( + this, + Invocation.method( + #getDocumentVerificationJobStatus, + [request], + ), + )), + returnValueForMissingStub: + _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse>.value( _FakeFlutterDocumentVerificationJobStatusResponse_6( - this, - Invocation.method( - #getDocumentVerificationJobStatus, - [request], - ), - )), - ) as _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse>); + this, + Invocation.method( + #getDocumentVerificationJobStatus, + [request], + ), + )), + ) as _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse>); @override _i3.Future<_i2.FlutterBiometricKycJobStatusResponse> getBiometricKycJobStatus( @@ -632,9 +619,8 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { [request], ), )), - returnValueForMissingStub: - _i3.Future<_i2.FlutterBiometricKycJobStatusResponse>.value( - _FakeFlutterBiometricKycJobStatusResponse_7( + returnValueForMissingStub: _i3.Future<_i2.FlutterBiometricKycJobStatusResponse>.value( + _FakeFlutterBiometricKycJobStatusResponse_7( this, Invocation.method( #getBiometricKycJobStatus, @@ -645,16 +631,13 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { @override _i3.Future<_i2.FlutterEnhancedDocumentVerificationJobStatusResponse> - getEnhancedDocumentVerificationJobStatus( - _i2.FlutterJobStatusRequest? request) => + getEnhancedDocumentVerificationJobStatus(_i2.FlutterJobStatusRequest? request) => (super.noSuchMethod( Invocation.method( #getEnhancedDocumentVerificationJobStatus, [request], ), - returnValue: _i3.Future< - _i2 - .FlutterEnhancedDocumentVerificationJobStatusResponse>.value( + returnValue: _i3.Future<_i2.FlutterEnhancedDocumentVerificationJobStatusResponse>.value( _FakeFlutterEnhancedDocumentVerificationJobStatusResponse_8( this, Invocation.method( @@ -662,18 +645,16 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { [request], ), )), - returnValueForMissingStub: _i3.Future< - _i2 - .FlutterEnhancedDocumentVerificationJobStatusResponse>.value( - _FakeFlutterEnhancedDocumentVerificationJobStatusResponse_8( + returnValueForMissingStub: + _i3.Future<_i2.FlutterEnhancedDocumentVerificationJobStatusResponse>.value( + _FakeFlutterEnhancedDocumentVerificationJobStatusResponse_8( this, Invocation.method( #getEnhancedDocumentVerificationJobStatus, [request], ), )), - ) as _i3.Future< - _i2.FlutterEnhancedDocumentVerificationJobStatusResponse>); + ) as _i3.Future<_i2.FlutterEnhancedDocumentVerificationJobStatusResponse>); @override _i3.Future<_i2.FlutterProductsConfigResponse> getProductsConfig( @@ -691,9 +672,8 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { [request], ), )), - returnValueForMissingStub: - _i3.Future<_i2.FlutterProductsConfigResponse>.value( - _FakeFlutterProductsConfigResponse_9( + returnValueForMissingStub: _i3.Future<_i2.FlutterProductsConfigResponse>.value( + _FakeFlutterProductsConfigResponse_9( this, Invocation.method( #getProductsConfig, @@ -718,9 +698,8 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { [request], ), )), - returnValueForMissingStub: - _i3.Future<_i2.FlutterValidDocumentsResponse>.value( - _FakeFlutterValidDocumentsResponse_10( + returnValueForMissingStub: _i3.Future<_i2.FlutterValidDocumentsResponse>.value( + _FakeFlutterValidDocumentsResponse_10( this, Invocation.method( #getValidDocuments, @@ -735,8 +714,7 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { #getServices, [], ), - returnValue: _i3.Future<_i2.FlutterServicesResponse>.value( - _FakeFlutterServicesResponse_11( + returnValue: _i3.Future<_i2.FlutterServicesResponse>.value(_FakeFlutterServicesResponse_11( this, Invocation.method( #getServices, @@ -744,8 +722,7 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.FlutterServicesResponse>.value( - _FakeFlutterServicesResponse_11( + _i3.Future<_i2.FlutterServicesResponse>.value(_FakeFlutterServicesResponse_11( this, Invocation.method( #getServices, @@ -781,9 +758,8 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ], ), )), - returnValueForMissingStub: - _i3.Future<_i2.FlutterSmartSelfieJobStatusResponse>.value( - _FakeFlutterSmartSelfieJobStatusResponse_4( + returnValueForMissingStub: _i3.Future<_i2.FlutterSmartSelfieJobStatusResponse>.value( + _FakeFlutterSmartSelfieJobStatusResponse_4( this, Invocation.method( #pollSmartSelfieJobStatus, @@ -797,92 +773,87 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ) as _i3.Future<_i2.FlutterSmartSelfieJobStatusResponse>); @override - _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse> - pollDocumentVerificationJobStatus( + _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse> pollDocumentVerificationJobStatus( _i2.FlutterJobStatusRequest? request, int? interval, int? numAttempts, ) => - (super.noSuchMethod( - Invocation.method( - #pollDocumentVerificationJobStatus, - [ - request, - interval, - numAttempts, - ], - ), - returnValue: _i3 - .Future<_i2.FlutterDocumentVerificationJobStatusResponse>.value( - _FakeFlutterDocumentVerificationJobStatusResponse_6( - this, - Invocation.method( - #pollDocumentVerificationJobStatus, - [ - request, - interval, - numAttempts, - ], - ), - )), - returnValueForMissingStub: _i3 - .Future<_i2.FlutterDocumentVerificationJobStatusResponse>.value( + (super.noSuchMethod( + Invocation.method( + #pollDocumentVerificationJobStatus, + [ + request, + interval, + numAttempts, + ], + ), + returnValue: _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse>.value( + _FakeFlutterDocumentVerificationJobStatusResponse_6( + this, + Invocation.method( + #pollDocumentVerificationJobStatus, + [ + request, + interval, + numAttempts, + ], + ), + )), + returnValueForMissingStub: + _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse>.value( _FakeFlutterDocumentVerificationJobStatusResponse_6( - this, - Invocation.method( - #pollDocumentVerificationJobStatus, - [ - request, - interval, - numAttempts, - ], - ), - )), - ) as _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse>); + this, + Invocation.method( + #pollDocumentVerificationJobStatus, + [ + request, + interval, + numAttempts, + ], + ), + )), + ) as _i3.Future<_i2.FlutterDocumentVerificationJobStatusResponse>); @override - _i3.Future<_i2.FlutterBiometricKycJobStatusResponse> - pollBiometricKycJobStatus( + _i3.Future<_i2.FlutterBiometricKycJobStatusResponse> pollBiometricKycJobStatus( _i2.FlutterJobStatusRequest? request, int? interval, int? numAttempts, ) => - (super.noSuchMethod( - Invocation.method( - #pollBiometricKycJobStatus, - [ - request, - interval, - numAttempts, - ], - ), - returnValue: - _i3.Future<_i2.FlutterBiometricKycJobStatusResponse>.value( - _FakeFlutterBiometricKycJobStatusResponse_7( - this, - Invocation.method( - #pollBiometricKycJobStatus, - [ - request, - interval, - numAttempts, - ], - ), - )), - returnValueForMissingStub: - _i3.Future<_i2.FlutterBiometricKycJobStatusResponse>.value( - _FakeFlutterBiometricKycJobStatusResponse_7( - this, - Invocation.method( - #pollBiometricKycJobStatus, - [ - request, - interval, - numAttempts, - ], - ), - )), - ) as _i3.Future<_i2.FlutterBiometricKycJobStatusResponse>); + (super.noSuchMethod( + Invocation.method( + #pollBiometricKycJobStatus, + [ + request, + interval, + numAttempts, + ], + ), + returnValue: _i3.Future<_i2.FlutterBiometricKycJobStatusResponse>.value( + _FakeFlutterBiometricKycJobStatusResponse_7( + this, + Invocation.method( + #pollBiometricKycJobStatus, + [ + request, + interval, + numAttempts, + ], + ), + )), + returnValueForMissingStub: _i3.Future<_i2.FlutterBiometricKycJobStatusResponse>.value( + _FakeFlutterBiometricKycJobStatusResponse_7( + this, + Invocation.method( + #pollBiometricKycJobStatus, + [ + request, + interval, + numAttempts, + ], + ), + )), + ) as _i3.Future<_i2.FlutterBiometricKycJobStatusResponse>); @override _i3.Future<_i2.FlutterEnhancedDocumentVerificationJobStatusResponse> @@ -900,9 +871,7 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { numAttempts, ], ), - returnValue: _i3.Future< - _i2 - .FlutterEnhancedDocumentVerificationJobStatusResponse>.value( + returnValue: _i3.Future<_i2.FlutterEnhancedDocumentVerificationJobStatusResponse>.value( _FakeFlutterEnhancedDocumentVerificationJobStatusResponse_8( this, Invocation.method( @@ -914,10 +883,9 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ], ), )), - returnValueForMissingStub: _i3.Future< - _i2 - .FlutterEnhancedDocumentVerificationJobStatusResponse>.value( - _FakeFlutterEnhancedDocumentVerificationJobStatusResponse_8( + returnValueForMissingStub: + _i3.Future<_i2.FlutterEnhancedDocumentVerificationJobStatusResponse>.value( + _FakeFlutterEnhancedDocumentVerificationJobStatusResponse_8( this, Invocation.method( #pollEnhancedDocumentVerificationJobStatus, @@ -928,8 +896,7 @@ class MockSmileIDApi extends _i1.Mock implements _i2.SmileIDApi { ], ), )), - ) as _i3.Future< - _i2.FlutterEnhancedDocumentVerificationJobStatusResponse>); + ) as _i3.Future<_i2.FlutterEnhancedDocumentVerificationJobStatusResponse>); } /// A class which mocks [FlutterAuthenticationRequest]. @@ -1024,8 +991,7 @@ class MockFlutterAuthenticationRequest extends _i1.Mock /// A class which mocks [FlutterEnhancedKycRequest]. /// /// See the documentation for Mockito's code generation for more information. -class MockFlutterEnhancedKycRequest extends _i1.Mock - implements _i2.FlutterEnhancedKycRequest { +class MockFlutterEnhancedKycRequest extends _i1.Mock implements _i2.FlutterEnhancedKycRequest { @override String get country => (super.noSuchMethod( Invocation.getter(#country), @@ -1169,8 +1135,7 @@ class MockFlutterEnhancedKycRequest extends _i1.Mock ) as _i2.FlutterPartnerParams); @override - set partnerParams(_i2.FlutterPartnerParams? _partnerParams) => - super.noSuchMethod( + set partnerParams(_i2.FlutterPartnerParams? _partnerParams) => super.noSuchMethod( Invocation.setter( #partnerParams, _partnerParams,