Skip to content

Commit

Permalink
feat: removed user matching and report v0 example
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-lorenzo committed Nov 8, 2023
1 parent 61c8fdd commit 1a017f1
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 232 deletions.
40 changes: 0 additions & 40 deletions alice/onboarding/onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from alice.onboarding.enums.document_source import DocumentSource
from alice.onboarding.enums.document_type import DocumentType
from alice.onboarding.enums.duplicates_resource_type import DuplicatesResourceType
from alice.onboarding.enums.match_case import MatchCase
from alice.onboarding.enums.onboarding_steps import OnboardingSteps
from alice.onboarding.enums.user_state import UserState
from alice.onboarding.enums.version import Version
Expand Down Expand Up @@ -1215,45 +1214,6 @@ def identify_user(
)
)

@early_return
def user_matching(
self,
user_id: str,
match_case: MatchCase,
verbose: bool = False,
) -> Result[bool, Union[OnboardingError, AuthError]]:
"""
It performs face matching between all the user selfies or documents. This call requires a BACKEND_TOKEN_WITH_USER_ID..
Parameters
----------
user_id
User identifier
match_case
Evidence (selfies or docs) on which to perform the matching
verbose
Used for print service response as well as the time elapsed
Returns
-------
A Result where if the operation is successful it returns a list of face matchings.
Otherwise, it returns an OnboardingError or AuthError.
"""
verbose = self.verbose or verbose
response = self.onboarding_client.user_matching(
user_id=user_id,
match_case=match_case,
verbose=verbose,
).unwrap_or_return()

if response.status_code == 200:
return Success(response.json())
else:
return Failure(
OnboardingError.from_response(
operation="user_matching", response=response
)
)

def enable_authentication(
self, user_id: str, verbose: bool = False
) -> Result[bool, Union[OnboardingError, AuthError]]:
Expand Down
46 changes: 0 additions & 46 deletions alice/onboarding/onboarding_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from alice.onboarding.enums.document_source import DocumentSource
from alice.onboarding.enums.document_type import DocumentType
from alice.onboarding.enums.duplicates_resource_type import DuplicatesResourceType
from alice.onboarding.enums.match_case import MatchCase
from alice.onboarding.enums.onboarding_steps import OnboardingSteps
from alice.onboarding.enums.user_state import UserState
from alice.onboarding.enums.version import Version
Expand Down Expand Up @@ -1381,51 +1380,6 @@ def identify_user(

return Success(response)

@early_return
def user_matching(
self,
user_id: str,
match_case: MatchCase,
verbose: bool = False,
) -> Result[Response, Error]:
"""
It performs face matching between all the user selfies or documents. This call requires a BACKEND_TOKEN_WITH_USER_ID..
Parameters
----------
user_id
User identifier
match_case
Evidence (selfies or docs) on which to perform the matching
verbose
Used for print service response as well as the time elapsed
Returns
-------
A Result object with Response object [requests library] if Success
"""
print_intro("user_matching", verbose=verbose)

backend_user_token = self.auth.create_backend_token(
user_id=user_id
).unwrap_or_return()
print_token("backend_token_with_user", backend_user_token, verbose=verbose)

headers = self._auth_headers(backend_user_token)

try:
response = self.session.get(
f"{self.url}/user/match?match_case={match_case.value}",
headers=headers,
timeout=self.timeout,
)
except requests.exceptions.Timeout:
return Failure(OnboardingError.timeout(operation="user_matching"))
print_response(response=response, verbose=verbose)

return Success(response)

@early_return
@timeit
def enable_authentication(
Expand Down
98 changes: 0 additions & 98 deletions examples/onboarding_report_v0.py

This file was deleted.

48 changes: 0 additions & 48 deletions examples/onboarding_with_user_matching.py

This file was deleted.

0 comments on commit 1a017f1

Please sign in to comment.