Skip to content

Commit

Permalink
Add required "purpose" field for ShareDocumentsRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
draperunner committed Oct 25, 2023
1 parent 4b4333f commit 641584f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions datatypes-examples.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@

<share-documents-request xmlns="http://api.digipost.no/schema/datatypes">
<max-share-duration>PT2160H</max-share-duration>
<purpose>We require to see your latest pay slip in order to grant you a loan.</purpose>
</share-documents-request>

<share-documents-request-event xmlns="http://api.digipost.no/schema/datatypes">
Expand Down
2 changes: 2 additions & 0 deletions datatypes.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@
<xs:complexType final="extension restriction" name="shareDocumentsRequest">
<xs:sequence>
<xs:element name="max-share-duration" type="xs:string"/>
<xs:element name="purpose" type="xs:string"/>
</xs:sequence>
</xs:complexType>

Expand Down Expand Up @@ -526,6 +527,7 @@

<xs:simpleType name="shareDocumentsRequestEventType">
<xs:restriction base="xs:string">
<xs:enumeration value="SHARING_STOPPED"/>
<xs:enumeration value="FILES_SHARED"/>
</xs:restriction>
</xs:simpleType>
Expand Down
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1091,12 +1091,14 @@ A request for a user to share one or more documents
|Name|Type|Required|Description|
|----|----|--------|-----------|
|maxShareDuration|Duration|yes|This is the maximum duration in which you are allowed to access the user's documents from they are shared with you|
|purpose|String|yes|This text should explain why you need to process the recipient's documents in a short and understandable way.|

### XML

```xml
<share-documents-request xmlns="http://api.digipost.no/schema/datatypes">
<max-share-duration>PT2160H</max-share-duration>
<purpose>We require to see your latest pay slip in order to grant you a loan.</purpose>
</share-documents-request>
```

Expand All @@ -1117,6 +1119,7 @@ An update or event related to a ShareDocumentsRequest
Valid values:

* FILES_SHARED
* SHARING_STOPPED

### XML

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ public class ShareDocumentsRequest implements DataType {
@Description("This is the maximum duration in which you are allowed to access the user's documents from they are shared with you")
Duration maxShareDuration;

public static final ShareDocumentsRequest EXAMPLE = new ShareDocumentsRequest(Duration.ofDays(90));
@XmlElement(name="purpose", required = true)
@NotNull
@Description("This text should explain why you need to process the recipient's documents in a short and understandable way.")
String purpose;

public static final ShareDocumentsRequest EXAMPLE = new ShareDocumentsRequest(
Duration.ofDays(90),
"We require to see your latest pay slip in order to grant you a loan."
);

}

0 comments on commit 641584f

Please sign in to comment.