Skip to content

Commit

Permalink
Merge pull request kbase#708 from MrCreosote/develop
Browse files Browse the repository at this point in the history
Implement API methods for admin object metadata
  • Loading branch information
MrCreosote committed Oct 26, 2023
2 parents b27b616 + fb149f4 commit 00cbbf3
Show file tree
Hide file tree
Showing 21 changed files with 2,218 additions and 494 deletions.
2 changes: 1 addition & 1 deletion docshtml/Workspace.html

Large diffs are not rendered by default.

455 changes: 454 additions & 1 deletion lib/Bio/KBase/workspace/Client.pm

Large diffs are not rendered by default.

1,171 changes: 769 additions & 402 deletions lib/biokbase/workspace/client.py

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions lib/javascript/workspace/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,19 @@ function Workspace(url, auth, auth_cb, timeout, async_job_check_time_ms, service
[], 1, _callback, _errorCallback);
};

this.alter_admin_object_metadata = function (params, _callback, _errorCallback) {
if (typeof params === 'function')
throw 'Argument params can not be a function';
if (_callback && typeof _callback !== 'function')
throw 'Argument _callback must be a function if defined';
if (_errorCallback && typeof _errorCallback !== 'function')
throw 'Argument _errorCallback must be a function if defined';
if (typeof arguments === 'function' && arguments.length > 1+2)
throw 'Too many arguments ('+arguments.length+' instead of '+(1+2)+')';
return json_call_ajax(_url, "Workspace.alter_admin_object_metadata",
[params], 0, _callback, _errorCallback);
};

this.administer = function (command, _callback, _errorCallback) {
if (typeof command === 'function')
throw 'Argument command can not be a function';
Expand Down
3 changes: 2 additions & 1 deletion src/us/kbase/workspace/AlterAdminObjectMetadataParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
* <pre>
* Input parameters for the alter_admin_object_metadata method.
* updates - the metadata updates to apply to the objects. If the same object is specified
* twice in the list, the update order is unspecified.
* twice in the list, the update order is unspecified. At most 1000 updates are allowed
* in one call.
* </pre>
*
*/
Expand Down
24 changes: 22 additions & 2 deletions src/us/kbase/workspace/GetObjectInfo3Params.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
* information should be fetched. Subsetting related parameters are
* ignored.
* Optional arguments:
* boolean includeMetadata - include the object metadata in the returned
* boolean infostruct - return information about the object as a structure rather than a tuple.
* Default false. If true, infos and paths will be null.
* boolean includeMetadata - include the user and admin metadata in the returned
* information. Default false.
* boolean ignoreErrors - Don't throw an exception if an object cannot
* be accessed; return null for that object's information and path instead.
Expand All @@ -33,13 +35,16 @@
@Generated("com.googlecode.jsonschema2pojo")
@JsonPropertyOrder({
"objects",
"infostruct",
"includeMetadata",
"ignoreErrors"
})
public class GetObjectInfo3Params {

@JsonProperty("objects")
private List<ObjectSpecification> objects;
@JsonProperty("infostruct")
private Long infostruct;
@JsonProperty("includeMetadata")
private Long includeMetadata;
@JsonProperty("ignoreErrors")
Expand All @@ -61,6 +66,21 @@ public GetObjectInfo3Params withObjects(List<ObjectSpecification> objects) {
return this;
}

@JsonProperty("infostruct")
public Long getInfostruct() {
return infostruct;
}

@JsonProperty("infostruct")
public void setInfostruct(Long infostruct) {
this.infostruct = infostruct;
}

public GetObjectInfo3Params withInfostruct(Long infostruct) {
this.infostruct = infostruct;
return this;
}

@JsonProperty("includeMetadata")
public Long getIncludeMetadata() {
return includeMetadata;
Expand Down Expand Up @@ -103,7 +123,7 @@ public void setAdditionalProperties(String name, Object value) {

@Override
public String toString() {
return ((((((((("GetObjectInfo3Params"+" [objects=")+ objects)+", includeMetadata=")+ includeMetadata)+", ignoreErrors=")+ ignoreErrors)+", additionalProperties=")+ additionalProperties)+"]");
return ((((((((((("GetObjectInfo3Params"+" [objects=")+ objects)+", infostruct=")+ infostruct)+", includeMetadata=")+ includeMetadata)+", ignoreErrors=")+ ignoreErrors)+", additionalProperties=")+ additionalProperties)+"]");
}

}
23 changes: 21 additions & 2 deletions src/us/kbase/workspace/GetObjectInfo3Results.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,25 @@
* list<object_info> infos - the object_info data for each object.
* list<list<obj_ref> paths - the path to the object through the object reference graph for
* each object. All the references in the path are absolute.
* list<ObjectInfo> infostructs - the ObjectInfo data for each object.
* </pre>
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("com.googlecode.jsonschema2pojo")
@JsonPropertyOrder({
"infos",
"paths"
"paths",
"infostructs"
})
public class GetObjectInfo3Results {

@JsonProperty("infos")
private List<Tuple11 <Long, String, String, String, Long, String, Long, String, String, Long, Map<String, String>>> infos;
@JsonProperty("paths")
private List<List<String>> paths;
@JsonProperty("infostructs")
private List<ObjectInfo> infostructs;
private Map<java.lang.String, Object> additionalProperties = new HashMap<java.lang.String, Object>();

@JsonProperty("infos")
Expand Down Expand Up @@ -67,6 +71,21 @@ public GetObjectInfo3Results withPaths(List<List<String>> paths) {
return this;
}

@JsonProperty("infostructs")
public List<ObjectInfo> getInfostructs() {
return infostructs;
}

@JsonProperty("infostructs")
public void setInfostructs(List<ObjectInfo> infostructs) {
this.infostructs = infostructs;
}

public GetObjectInfo3Results withInfostructs(List<ObjectInfo> infostructs) {
this.infostructs = infostructs;
return this;
}

@JsonAnyGetter
public Map<java.lang.String, Object> getAdditionalProperties() {
return this.additionalProperties;
Expand All @@ -79,7 +98,7 @@ public void setAdditionalProperties(java.lang.String name, Object value) {

@Override
public java.lang.String toString() {
return ((((((("GetObjectInfo3Results"+" [infos=")+ infos)+", paths=")+ paths)+", additionalProperties=")+ additionalProperties)+"]");
return ((((((((("GetObjectInfo3Results"+" [infos=")+ infos)+", paths=")+ paths)+", infostructs=")+ infostructs)+", additionalProperties=")+ additionalProperties)+"]");
}

}
23 changes: 22 additions & 1 deletion src/us/kbase/workspace/GetObjects2Params.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
* boolean ignoreErrors - Don't throw an exception if an object cannot
* be accessed; return null for that object's information instead.
* Default false.
* boolean infostruct - return the object information as a structure rather than a tuple.
* Default false. If true, ObjectData.path will be null as it is provided in
* the ObjectInfo data.
* boolean no_data - return the provenance, references, and
* object_info for this object without the object data. Default false.
* boolean skip_external_system_updates - if the objects contain any external IDs, don't
Expand All @@ -44,6 +47,7 @@
@JsonPropertyOrder({
"objects",
"ignoreErrors",
"infostruct",
"no_data",
"skip_external_system_updates",
"batch_external_system_updates"
Expand All @@ -54,6 +58,8 @@ public class GetObjects2Params {
private List<ObjectSpecification> objects;
@JsonProperty("ignoreErrors")
private Long ignoreErrors;
@JsonProperty("infostruct")
private Long infostruct;
@JsonProperty("no_data")
private Long noData;
@JsonProperty("skip_external_system_updates")
Expand Down Expand Up @@ -92,6 +98,21 @@ public GetObjects2Params withIgnoreErrors(Long ignoreErrors) {
return this;
}

@JsonProperty("infostruct")
public Long getInfostruct() {
return infostruct;
}

@JsonProperty("infostruct")
public void setInfostruct(Long infostruct) {
this.infostruct = infostruct;
}

public GetObjects2Params withInfostruct(Long infostruct) {
this.infostruct = infostruct;
return this;
}

@JsonProperty("no_data")
public Long getNoData() {
return noData;
Expand Down Expand Up @@ -149,7 +170,7 @@ public void setAdditionalProperties(String name, Object value) {

@Override
public String toString() {
return ((((((((((((("GetObjects2Params"+" [objects=")+ objects)+", ignoreErrors=")+ ignoreErrors)+", noData=")+ noData)+", skipExternalSystemUpdates=")+ skipExternalSystemUpdates)+", batchExternalSystemUpdates=")+ batchExternalSystemUpdates)+", additionalProperties=")+ additionalProperties)+"]");
return ((((((((((((((("GetObjects2Params"+" [objects=")+ objects)+", ignoreErrors=")+ ignoreErrors)+", infostruct=")+ infostruct)+", noData=")+ noData)+", skipExternalSystemUpdates=")+ skipExternalSystemUpdates)+", batchExternalSystemUpdates=")+ batchExternalSystemUpdates)+", additionalProperties=")+ additionalProperties)+"]");
}

}
90 changes: 89 additions & 1 deletion src/us/kbase/workspace/ObjectData.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* The data and supplemental info for an object.
* UnspecifiedObject data - the object's data or subset data.
* object_info info - information about the object.
* ObjectInfo infostruct - information about the object as a structure rather than a tuple.
* list<obj_ref> path - the path to the object through the object reference graph. All the
* references in the path are absolute.
* list<ProvenanceAction> provenance - the object's provenance.
Expand Down Expand Up @@ -53,6 +54,7 @@
@JsonPropertyOrder({
"data",
"info",
"infostruct",
"path",
"provenance",
"creator",
Expand All @@ -72,6 +74,31 @@ public class ObjectData {
private UObject data;
@JsonProperty("info")
private Tuple11 <Long, String, String, String, Long, String, Long, String, String, Long, Map<String, String>> info;
/**
* <p>Original spec-file type: ObjectInfo</p>
* <pre>
* Information about an object as a struct rather than a tuple.
* This allows adding fields in a backward compatible way in the future.
* Includes more fields than object_info.
* obj_id objid - the numerical id of the object.
* obj_name name - the name of the object.
* type_string type - the type of the object.
* timestamp save_date - the save date of the object.
* obj_ver ver - the version of the object.
* username saved_by - the user that saved or copied the object.
* ws_id wsid - the workspace containing the object.
* ws_name workspace - the workspace containing the object.
* string chsum - the md5 checksum of the object.
* int size - the size of the object in bytes.
* usermeta meta - arbitrary user-supplied metadata about the object.
* usermeta adminmeta - service administrator metadata set on an object. Unlike most
* other object fields, admin metadata is mutable.
* list<obj_ref> path - the path to the object.
* </pre>
*
*/
@JsonProperty("infostruct")
private ObjectInfo infostruct;
@JsonProperty("path")
private List<String> path;
@JsonProperty("provenance")
Expand Down Expand Up @@ -128,6 +155,67 @@ public ObjectData withInfo(Tuple11 <Long, String, String, String, Long, String,
return this;
}

/**
* <p>Original spec-file type: ObjectInfo</p>
* <pre>
* Information about an object as a struct rather than a tuple.
* This allows adding fields in a backward compatible way in the future.
* Includes more fields than object_info.
* obj_id objid - the numerical id of the object.
* obj_name name - the name of the object.
* type_string type - the type of the object.
* timestamp save_date - the save date of the object.
* obj_ver ver - the version of the object.
* username saved_by - the user that saved or copied the object.
* ws_id wsid - the workspace containing the object.
* ws_name workspace - the workspace containing the object.
* string chsum - the md5 checksum of the object.
* int size - the size of the object in bytes.
* usermeta meta - arbitrary user-supplied metadata about the object.
* usermeta adminmeta - service administrator metadata set on an object. Unlike most
* other object fields, admin metadata is mutable.
* list<obj_ref> path - the path to the object.
* </pre>
*
*/
@JsonProperty("infostruct")
public ObjectInfo getInfostruct() {
return infostruct;
}

/**
* <p>Original spec-file type: ObjectInfo</p>
* <pre>
* Information about an object as a struct rather than a tuple.
* This allows adding fields in a backward compatible way in the future.
* Includes more fields than object_info.
* obj_id objid - the numerical id of the object.
* obj_name name - the name of the object.
* type_string type - the type of the object.
* timestamp save_date - the save date of the object.
* obj_ver ver - the version of the object.
* username saved_by - the user that saved or copied the object.
* ws_id wsid - the workspace containing the object.
* ws_name workspace - the workspace containing the object.
* string chsum - the md5 checksum of the object.
* int size - the size of the object in bytes.
* usermeta meta - arbitrary user-supplied metadata about the object.
* usermeta adminmeta - service administrator metadata set on an object. Unlike most
* other object fields, admin metadata is mutable.
* list<obj_ref> path - the path to the object.
* </pre>
*
*/
@JsonProperty("infostruct")
public void setInfostruct(ObjectInfo infostruct) {
this.infostruct = infostruct;
}

public ObjectData withInfostruct(ObjectInfo infostruct) {
this.infostruct = infostruct;
return this;
}

@JsonProperty("path")
public List<String> getPath() {
return path;
Expand Down Expand Up @@ -320,7 +408,7 @@ public void setAdditionalProperties(java.lang.String name, Object value) {

@Override
public java.lang.String toString() {
return ((((((((((((((((((((((((((((((("ObjectData"+" [data=")+ data)+", info=")+ info)+", path=")+ path)+", provenance=")+ provenance)+", creator=")+ creator)+", origWsid=")+ origWsid)+", created=")+ created)+", epoch=")+ epoch)+", refs=")+ refs)+", copied=")+ copied)+", copySourceInaccessible=")+ copySourceInaccessible)+", extractedIds=")+ extractedIds)+", handleError=")+ handleError)+", handleStacktrace=")+ handleStacktrace)+", additionalProperties=")+ additionalProperties)+"]");
return ((((((((((((((((((((((((((((((((("ObjectData"+" [data=")+ data)+", info=")+ info)+", infostruct=")+ infostruct)+", path=")+ path)+", provenance=")+ provenance)+", creator=")+ creator)+", origWsid=")+ origWsid)+", created=")+ created)+", epoch=")+ epoch)+", refs=")+ refs)+", copied=")+ copied)+", copySourceInaccessible=")+ copySourceInaccessible)+", extractedIds=")+ extractedIds)+", handleError=")+ handleError)+", handleStacktrace=")+ handleStacktrace)+", additionalProperties=")+ additionalProperties)+"]");
}

}
Loading

0 comments on commit 00cbbf3

Please sign in to comment.