@@ -55,9 +55,24 @@ public ApiResponse ping(Map options) throws Exception {
5555
5656 public ApiResponse usage (Map options ) throws Exception {
5757 if (options == null ) options = ObjectUtils .emptyMap ();
58- return callApi (HttpMethod .GET , Arrays .asList ("usage" ), ObjectUtils .emptyMap (), options );
58+
59+ final List <String > uri = new ArrayList <String >();
60+ uri .add ("usage" );
61+
62+ Object date = options .get ("date" );
63+
64+ if (date != null ) {
65+ if (date instanceof Date ) {
66+ date = ObjectUtils .toUsageApiDateFormat ((Date ) date );
67+ }
68+
69+ uri .add (date .toString ());
70+ }
71+
72+ return callApi (HttpMethod .GET , uri , ObjectUtils .emptyMap (), options );
5973 }
6074
75+
6176 public ApiResponse resourceTypes (Map options ) throws Exception {
6277 if (options == null ) options = ObjectUtils .emptyMap ();
6378 return callApi (HttpMethod .GET , Arrays .asList ("resources" ), ObjectUtils .emptyMap (), options );
@@ -543,7 +558,8 @@ public ApiResponse updateResourcesAccessModeByTag(String accessMode, String tag,
543558
544559 /**
545560 * Delete a folder (must be empty).
546- * @param folder The full path of the folder to delete
561+ *
562+ * @param folder The full path of the folder to delete
547563 * @param options additional options.
548564 * @return The operation result.
549565 * @throws Exception When the folder isn't empty or doesn't exist.
@@ -588,6 +604,7 @@ private ApiResponse updateResourcesAccessMode(String accessMode, String byKey, O
588604
589605 /**
590606 * Add a new metadata field definition
607+ *
591608 * @param field The field to add.
592609 * @return A map representing the newly added field.
593610 * @throws Exception
@@ -599,6 +616,7 @@ public ApiResponse addMetadataField(MetadataField field) throws Exception {
599616
600617 /**
601618 * List all the metadata field definitions (structure, not values)
619+ *
602620 * @return A map containing the list of field definitions maps.
603621 * @throws Exception
604622 */
@@ -608,6 +626,7 @@ public ApiResponse listMetadataFields() throws Exception {
608626
609627 /**
610628 * Get a metadata field definition by id
629+ *
611630 * @param fieldExternalId The id of the field to retrieve
612631 * @return The fields definitions.
613632 * @throws Exception
@@ -618,8 +637,9 @@ public ApiResponse metadataFieldByFieldId(String fieldExternalId) throws Excepti
618637
619638 /**
620639 * Update the definitions of a single metadata field.
640+ *
621641 * @param fieldExternalId The id of the field to update
622- * @param field The field definition
642+ * @param field The field definition
623643 * @return The updated fields definition.
624644 * @throws Exception
625645 */
@@ -630,9 +650,10 @@ public ApiResponse updateMetadataField(String fieldExternalId, MetadataField fie
630650
631651 /**
632652 * Update the datasource entries for a given field
653+ *
633654 * @param fieldExternalId The id of the field to update
634- * @param entries A list of datasource entries. Existing entries (according to entry id) will be updated,
635- * new entries will be added.
655+ * @param entries A list of datasource entries. Existing entries (according to entry id) will be updated,
656+ * new entries will be added.
636657 * @return The updated field definition.
637658 * @throws Exception
638659 */
@@ -643,7 +664,8 @@ public ApiResponse updateMetadataFieldDatasource(String fieldExternalId, List<Me
643664
644665 /**
645666 * Delete data source entries for a given field
646- * @param fieldExternalId The id of the field to update
667+ *
668+ * @param fieldExternalId The id of the field to update
647669 * @param entriesExternalId The ids of all the entries to delete from the data source
648670 * @return The remaining datasource entries.
649671 * @throws Exception
@@ -655,7 +677,8 @@ public ApiResponse deleteDatasourceEntries(String fieldExternalId, List<String>
655677
656678 /**
657679 * Restore deleted data source entries for a given field
658- * @param fieldExternalId The id of the field to operate
680+ *
681+ * @param fieldExternalId The id of the field to operate
659682 * @param entriesExternalId The ids of all the entries to restore from the data source
660683 * @return The datasource entries state after restore
661684 * @throws Exception
@@ -667,6 +690,7 @@ public ApiResponse restoreDatasourceEntries(String fieldExternalId, List<String>
667690
668691 /**
669692 * Delete a field definition.
693+ *
670694 * @param fieldExternalId The id of the field to delete
671695 * @return A map with a "message" key. "ok" value indicates a successful deletion.
672696 * @throws Exception
0 commit comments