Skip to content

Conversation

Copy link

Copilot AI commented Dec 10, 2025

Implements support for requesting and retrieving SHARE_CODE resources in Doc Scan sessions per SDK-2752 requirements.

Session Creation

  • RequiredShareCode: New model with issuer and scheme fields (no SDK-level validation)
  • SessionSpec: Extended with required_share_codes array parameter
  • SessionSpecBuilder: Added with_required_share_code() method
from yoti_python_sdk.doc_scan import SessionSpecBuilder, RequiredShareCodeBuilder

share_code = (
    RequiredShareCodeBuilder()
    .with_issuer("some-issuer")
    .with_scheme("some-scheme")
    .build()
)

session_spec = (
    SessionSpecBuilder()
    .with_required_share_code(share_code)
    # ... other config
    .build()
)

Session Retrieval

  • ShareCodeResourceResponse: Parses share code resources with id, source, created_at, last_updated, lookup_profile, returned_profile, id_photo, file (all with media attributes)
  • VerifyShareCodeTaskResponse: Handles VERIFY_SHARE_CODE_TASK type with generated_media support
  • ResourceContainer: Extended with share_codes property
# Access share codes from session response
result = doc_scan_client.get_session(session_id)
share_codes = result.resources.share_codes

for share_code in share_codes:
    print(f"ID: {share_code.id}")
    print(f"Tasks: {len(share_code.tasks)}")

Testing

Added comprehensive unit tests for all new components (27 tests). All existing tests pass.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add support for requesting SHARE_CODE resources Add SHARE_CODE resource support for session creation and retrieval Dec 10, 2025
Copilot AI requested a review from mehmet-yoti December 10, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants