use of ml.comet.experiment.impl.constants.QueryParamName in project comet-java-sdk by comet-ml.
the class RestApiUtils method assetQueryParameters.
/**
* Extracts query parameters from the provided {@link Asset}.
*
* @param asset the {@link AssetImpl} to extract HTTP query parameters from.
* @param experimentKey the key of the Comet experiment.
* @return the map with query parameters.
*/
public static Map<QueryParamName, String> assetQueryParameters(@NonNull final AssetImpl asset, @NonNull String experimentKey) {
Map<QueryParamName, String> queryParams = new HashMap<>();
queryParams.put(EXPERIMENT_KEY, experimentKey);
queryParams.put(TYPE, asset.getType());
putNotNull(queryParams, OVERWRITE, asset.getOverwrite());
putNotNull(queryParams, FILE_NAME, asset.getLogicalPath());
putNotNull(queryParams, EXTENSION, asset.getFileExtension());
if (asset.getExperimentContext().isPresent()) {
ExperimentContext context = asset.getExperimentContext().get();
putNotNull(queryParams, CONTEXT, context.getContext());
putNotNull(queryParams, STEP, context.getStep());
putNotNull(queryParams, EPOCH, context.getEpoch());
}
if (asset.getGroupingName().isPresent()) {
queryParams.put(GROUPING_NAME, asset.getGroupingName().get());
}
return queryParams;
}
Aggregations