Skip to content

Commit

Permalink
fixup! SDK-2262: Add Digital Identity Session Receipt retrieval service
Browse files Browse the repository at this point in the history
  • Loading branch information
irotech committed Aug 1, 2023
1 parent dcf4800 commit 316024c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,44 +35,36 @@ public class DigitalIdentityClient {
}

/**
* Create a sharing session to initiate a sharing process based on a policy
* Create a sharing session to initiate a sharing process based on a policy.
*
* @param request Details of the request like policy, extensions and push notification for the application
* @return ID, status and expiry of the newly created share session
* @throws DigitalIdentityException Thrown if the session creation is unsuccessful
*/
public ShareSession createShareSession(ShareSessionRequest request) throws DigitalIdentityException {
return identityService.createShareSession(sdkId, keyPair, request);
}

/**
* Retrieve the sharing session
* Retrieve the sharing session.
*
* @param sessionId ID of the session to retrieve
* @return ID, status and expiry of the share session
* @throws DigitalIdentityException Thrown if the session retrieval is unsuccessful
*/
public ShareSession fetchShareSession(String sessionId) throws DigitalIdentityException {
return identityService.fetchShareSession(sdkId, keyPair, sessionId);
}

/**
* Create a sharing session QR code to initiate a sharing process based on a policy
* Create a sharing session QR code to initiate a sharing process based on a policy.
*
* @param sessionId Session ID the QR code will belong to
* @return ID and URI of the newly created share session QR code
* @throws DigitalIdentityException Thrown if the QR code creation is unsuccessful
*/
public ShareSessionQrCode createShareQrCode(String sessionId) throws DigitalIdentityException {
return identityService.createShareQrCode(sdkId, keyPair, sessionId);
}

/**
* Retrieve the sharing session QR code
* Retrieve the sharing session QR code.
*
* @param qrCodeId ID of the QR code to retrieve
* @return The content of the share session QR code
* @throws DigitalIdentityException Thrown if the QR code retrieval is unsuccessful
*/
public ShareSessionQrCode fetchShareQrCode(String qrCodeId) throws DigitalIdentityException {
return identityService.fetchShareQrCode(sdkId, keyPair, qrCodeId);
Expand All @@ -83,9 +75,7 @@ public ShareSessionQrCode fetchShareQrCode(String qrCodeId) throws DigitalIdenti
*
* <p>A receipt will contain the shared user attributes.</p>
*
* @param receiptId ID of the receipt
* @return Shared user attributes
* @throws DigitalIdentityException Thrown if the receipt retrieval is unsuccessful
*/
public Receipt fetchShareReceipt(String receiptId) throws DigitalIdentityException {
return identityService.fetchShareReceipt(sdkId, keyPair, receiptId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.yoti.api.client.identity.policy;

import java.util.Objects;

import com.yoti.validation.Validation;

import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -25,6 +27,23 @@ public String getSubType() {
return subType;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WantedAnchor that = (WantedAnchor) o;
return Objects.equals(value, that.value) && Objects.equals(subType, that.subType);
}

@Override
public int hashCode() {
return Objects.hash(value, subType);
}

public static Builder builder() {
return new Builder();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public List<Constraint> getConstraints() {
return constraints;
}

public boolean hasConstraints() {
return !constraints.isEmpty();
}

public static Builder builder() {
return new Builder();
}
Expand Down

0 comments on commit 316024c

Please sign in to comment.