From 1c429aa484f85e49cc96abdbcc040e0f9b667cf4 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Thu, 19 Sep 2024 20:20:37 +0100 Subject: [PATCH 1/2] SDK-2469-added-go-idv-support-brand-id-in-session-config --- docscan/session/create/sdk_config.go | 8 ++++++++ docscan/session/create/sdk_config_test.go | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/docscan/session/create/sdk_config.go b/docscan/session/create/sdk_config.go index 1477ce5e..575a9287 100644 --- a/docscan/session/create/sdk_config.go +++ b/docscan/session/create/sdk_config.go @@ -15,6 +15,7 @@ type SDKConfig struct { PrivacyPolicyUrl string `json:"privacy_policy_url,omitempty"` AttemptsConfiguration *AttemptsConfiguration `json:"attempts_configuration,omitempty"` AllowHandOff bool `json:"allow_handoff,omitempty"` + BrandId string `json:"brand_id,omitempty"` } type AttemptsConfiguration struct { @@ -39,6 +40,7 @@ type SdkConfigBuilder struct { privacyPolicyUrl string idDocumentTextDataExtractionAttempts map[string]int allowHandOff bool + brandId string } // WithAllowedCaptureMethods sets the allowed capture methods on the builder @@ -126,6 +128,11 @@ func (b *SdkConfigBuilder) WithAllowHandOff(allowHandOff bool) *SdkConfigBuilder return b } +func (b *SdkConfigBuilder) WithBrandId(brandId string) *SdkConfigBuilder { + b.brandId = brandId + return b +} + // Build builds the SDKConfig struct using the supplied values func (b *SdkConfigBuilder) Build() (*SDKConfig, error) { sdkConf := &SDKConfig{ @@ -140,6 +147,7 @@ func (b *SdkConfigBuilder) Build() (*SDKConfig, error) { b.privacyPolicyUrl, nil, b.allowHandOff, + b.brandId, } if b.idDocumentTextDataExtractionAttempts != nil { diff --git a/docscan/session/create/sdk_config_test.go b/docscan/session/create/sdk_config_test.go index f766b75c..e337bdf9 100644 --- a/docscan/session/create/sdk_config_test.go +++ b/docscan/session/create/sdk_config_test.go @@ -117,3 +117,23 @@ func ExampleSdkConfigBuilder_WithAllowHandOff() { fmt.Println(string(data)) // Output: {"allow_handoff":true} } + +func ExampleSdkConfigBuilder_WithBrandId() { + sdkConfig, err := NewSdkConfigBuilder(). + WithBrandId("some_brand_id"). + Build() + + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + data, err := json.Marshal(sdkConfig) + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + fmt.Println(string(data)) + // Output: {"brand_id":"some_brand_id"} +} From e5485c6c078e58dfc0f8c5864ca02ed35e6b5619 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Thu, 19 Sep 2024 21:59:02 +0100 Subject: [PATCH 2/2] SDK-2469-added-examples-for-go-idv-support-brand-id-in-session-config --- _examples/idv/models.sessionspec.go | 1 + 1 file changed, 1 insertion(+) diff --git a/_examples/idv/models.sessionspec.go b/_examples/idv/models.sessionspec.go index 6f7c4748..970ec696 100644 --- a/_examples/idv/models.sessionspec.go +++ b/_examples/idv/models.sessionspec.go @@ -99,6 +99,7 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) { WithPrivacyPolicyUrl("https://localhost:8080/privacy-policy"). WithIdDocumentTextExtractionGenericAttempts(2). WithAllowHandOff(true). + WithBrandId("some_brand_id"). Build() if err != nil { return nil, err