Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mfriesen committed Oct 17, 2024
1 parent db27c96 commit ad80cf1
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -709,4 +709,31 @@ public static GetDocumentVersionsResponse waitForDocumentVersions(final ApiClien
TimeUnit.SECONDS.sleep(1);
}
}

/**
* Wait for Document Attribute.
*
* @param client {@link ApiClient}
* @param siteId {@link String}
* @param documentId {@link String}
* @param attributeKey {@link String}
* @return DocumentAttribute
* @throws InterruptedException InterruptedException
*/
public static DocumentAttribute waitForDocumentAtrribute(final ApiClient client, final String siteId,
final String documentId, final String attributeKey) throws InterruptedException {
DocumentAttributesApi documentAttributesApi = new DocumentAttributesApi(client);

while (true) {

try {
return documentAttributesApi.getDocumentAttribute(documentId, attributeKey, siteId)
.getAttribute();
} catch (ApiException e) {
// ignore
}

TimeUnit.SECONDS.sleep(1);
}
}
}

0 comments on commit ad80cf1

Please sign in to comment.