mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-01 14:41:46 +00:00
[REPO-5552] expose aspect/type end points (#117)
* [REPO-5552] TAS rest API * * docs update
This commit is contained in:
@@ -36,6 +36,7 @@ import org.alfresco.rest.requests.authAPI.RestAuthAPI;
|
|||||||
import org.alfresco.rest.requests.cmisAPI.RestCmisAPI;
|
import org.alfresco.rest.requests.cmisAPI.RestCmisAPI;
|
||||||
import org.alfresco.rest.requests.coreAPI.RestCoreAPI;
|
import org.alfresco.rest.requests.coreAPI.RestCoreAPI;
|
||||||
import org.alfresco.rest.requests.discoveryAPI.RestDiscoveryAPI;
|
import org.alfresco.rest.requests.discoveryAPI.RestDiscoveryAPI;
|
||||||
|
import org.alfresco.rest.requests.modelAPI.RestModelAPI;
|
||||||
import org.alfresco.rest.requests.privateAPI.RestPrivateAPI;
|
import org.alfresco.rest.requests.privateAPI.RestPrivateAPI;
|
||||||
import org.alfresco.rest.requests.search.SearchAPI;
|
import org.alfresco.rest.requests.search.SearchAPI;
|
||||||
import org.alfresco.rest.requests.search.SearchSQLAPI;
|
import org.alfresco.rest.requests.search.SearchSQLAPI;
|
||||||
@@ -932,6 +933,11 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
|
|||||||
return new RestAuthAPI(this);
|
return new RestAuthAPI(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RestModelAPI withModelAPI()
|
||||||
|
{
|
||||||
|
return new RestModelAPI(this);
|
||||||
|
}
|
||||||
|
|
||||||
public SearchAPI withSearchAPI()
|
public SearchAPI withSearchAPI()
|
||||||
{
|
{
|
||||||
return new SearchAPI(this);
|
return new SearchAPI(this);
|
||||||
|
@@ -0,0 +1,158 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import org.alfresco.rest.core.IRestModel;
|
||||||
|
import org.alfresco.rest.core.assertion.ModelAssertion;
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RestAbstractClassModel extends TestModel implements IRestModel<RestAbstractClassModel>
|
||||||
|
{
|
||||||
|
@JsonProperty(value = "entry")
|
||||||
|
RestAbstractClassModel model;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RestAbstractClassModel onModel()
|
||||||
|
{
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String id;
|
||||||
|
public String title;
|
||||||
|
public String description;
|
||||||
|
public String parentId;
|
||||||
|
public Boolean isContainer = null;
|
||||||
|
public Boolean isArchive = null;
|
||||||
|
public Boolean includedInSupertypeQuery = null;
|
||||||
|
public List<String> mandatoryAspects = null;
|
||||||
|
public List<RestClassAssociationModel> associations = null;
|
||||||
|
public List <RestPropertyDefinitionModel> properties = null;
|
||||||
|
|
||||||
|
@JsonProperty(value = "model")
|
||||||
|
public RestClassModel modelInfo;
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentId()
|
||||||
|
{
|
||||||
|
return parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentId(String parentId)
|
||||||
|
{
|
||||||
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getContainer()
|
||||||
|
{
|
||||||
|
return isContainer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContainer(Boolean container)
|
||||||
|
{
|
||||||
|
isContainer = container;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getArchive()
|
||||||
|
{
|
||||||
|
return isArchive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArchive(Boolean archive)
|
||||||
|
{
|
||||||
|
isArchive = archive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIncludedInSupertypeQuery()
|
||||||
|
{
|
||||||
|
return includedInSupertypeQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncludedInSupertypeQuery(Boolean includedInSupertypeQuery)
|
||||||
|
{
|
||||||
|
this.includedInSupertypeQuery = includedInSupertypeQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getMandatoryAspects()
|
||||||
|
{
|
||||||
|
return mandatoryAspects;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMandatoryAspects(List<String> mandatoryAspects)
|
||||||
|
{
|
||||||
|
this.mandatoryAspects = mandatoryAspects;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RestClassAssociationModel> getAssociations()
|
||||||
|
{
|
||||||
|
return associations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssociations(List<RestClassAssociationModel> associations)
|
||||||
|
{
|
||||||
|
this.associations = associations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RestPropertyDefinitionModel> getProperties() {
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProperties(List<RestPropertyDefinitionModel> properties)
|
||||||
|
{
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestClassModel getModelInfo()
|
||||||
|
{
|
||||||
|
return modelInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModelInfo(RestClassModel modelInfo)
|
||||||
|
{
|
||||||
|
this.modelInfo = modelInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DSL for assertion on this rest model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestAbstractClassModel> assertThat()
|
||||||
|
{
|
||||||
|
return new ModelAssertion<RestAbstractClassModel>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestAbstractClassModel> and()
|
||||||
|
{
|
||||||
|
return assertThat();
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,5 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
public class RestAspectModel extends RestAbstractClassModel
|
||||||
|
{
|
||||||
|
}
|
@@ -0,0 +1,7 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.rest.core.RestModels;
|
||||||
|
|
||||||
|
public class RestAspectsCollection extends RestModels<RestAspectModel, RestAspectsCollection>
|
||||||
|
{
|
||||||
|
}
|
@@ -0,0 +1,62 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
public class RestClassAssociationDefinitionModel extends TestModel
|
||||||
|
{
|
||||||
|
public String role = null;
|
||||||
|
public String cls = null;
|
||||||
|
public Boolean isMany = null;
|
||||||
|
public Boolean isMandatory = null;
|
||||||
|
public Boolean isMandatoryEnforced = null;
|
||||||
|
|
||||||
|
public String getRole()
|
||||||
|
{
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(String role)
|
||||||
|
{
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCls()
|
||||||
|
{
|
||||||
|
return cls;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCls(String cls)
|
||||||
|
{
|
||||||
|
this.cls = cls;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getMany()
|
||||||
|
{
|
||||||
|
return isMany;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMany(Boolean many)
|
||||||
|
{
|
||||||
|
isMany = many;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getMandatory()
|
||||||
|
{
|
||||||
|
return isMandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMandatory(Boolean mandatory)
|
||||||
|
{
|
||||||
|
isMandatory = mandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getMandatoryEnforced()
|
||||||
|
{
|
||||||
|
return isMandatoryEnforced;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMandatoryEnforced(Boolean mandatoryEnforced)
|
||||||
|
{
|
||||||
|
isMandatoryEnforced = mandatoryEnforced;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,86 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
public class RestClassAssociationModel extends TestModel
|
||||||
|
{
|
||||||
|
public String id;
|
||||||
|
public String title;
|
||||||
|
public String description;
|
||||||
|
public Boolean isChild;
|
||||||
|
public Boolean isProtected;
|
||||||
|
public RestClassAssociationDefinitionModel source = null;
|
||||||
|
public RestClassAssociationDefinitionModel target = null;
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getChild()
|
||||||
|
{
|
||||||
|
return isChild;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsChild(Boolean isChild)
|
||||||
|
{
|
||||||
|
this.isChild = isChild;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIsProtected()
|
||||||
|
{
|
||||||
|
return isProtected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsProtected(Boolean isProtected)
|
||||||
|
{
|
||||||
|
this.isProtected = isProtected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestClassAssociationDefinitionModel getSource()
|
||||||
|
{
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSource(RestClassAssociationDefinitionModel source)
|
||||||
|
{
|
||||||
|
this.source = source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestClassAssociationDefinitionModel getTarget()
|
||||||
|
{
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTarget(RestClassAssociationDefinitionModel target)
|
||||||
|
{
|
||||||
|
this.target = target;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@@ -0,0 +1,62 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
public class RestClassModel extends TestModel
|
||||||
|
{
|
||||||
|
public String id;
|
||||||
|
public String author;
|
||||||
|
public String description;
|
||||||
|
public String namespaceUri;
|
||||||
|
public String namespacePrefix;
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthor()
|
||||||
|
{
|
||||||
|
return author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthor(String author)
|
||||||
|
{
|
||||||
|
this.author = author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNamespaceUri()
|
||||||
|
{
|
||||||
|
return namespaceUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNamespaceUri(String namespaceUri)
|
||||||
|
{
|
||||||
|
this.namespaceUri = namespaceUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNamespacePrefix()
|
||||||
|
{
|
||||||
|
return namespacePrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNamespacePrefix(String namespacePrefix)
|
||||||
|
{
|
||||||
|
this.namespacePrefix = namespacePrefix;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,62 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class RestConstraintDefinitionModel
|
||||||
|
{
|
||||||
|
private String id;
|
||||||
|
private String type;
|
||||||
|
private String title;
|
||||||
|
private String description;
|
||||||
|
private Map<String, Object> parameters;
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType()
|
||||||
|
{
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type)
|
||||||
|
{
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getParameters()
|
||||||
|
{
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParameters(Map<String, Object> parameters)
|
||||||
|
{
|
||||||
|
this.parameters = parameters;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,117 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RestPropertyDefinitionModel
|
||||||
|
{
|
||||||
|
private String id;
|
||||||
|
private String title;
|
||||||
|
private String description;
|
||||||
|
private String defaultValue;
|
||||||
|
private String dataType;
|
||||||
|
private Boolean isMultiValued;
|
||||||
|
private Boolean isMandatory;
|
||||||
|
private Boolean isMandatoryEnforced;
|
||||||
|
private Boolean isProtected;
|
||||||
|
private List<RestConstraintDefinitionModel> constraints;
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultValue()
|
||||||
|
{
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefaultValue(String defaultValue)
|
||||||
|
{
|
||||||
|
this.defaultValue = defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataType()
|
||||||
|
{
|
||||||
|
return dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataType(String dataType)
|
||||||
|
{
|
||||||
|
this.dataType = dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsProtected()
|
||||||
|
{
|
||||||
|
return isProtected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsProtected(boolean isProtected)
|
||||||
|
{
|
||||||
|
this.isProtected = isProtected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RestConstraintDefinitionModel> getConstraints()
|
||||||
|
{
|
||||||
|
return constraints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConstraints(List<RestConstraintDefinitionModel> constraints)
|
||||||
|
{
|
||||||
|
this.constraints = constraints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsMultiValued()
|
||||||
|
{
|
||||||
|
return isMultiValued;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsMultiValued(boolean isMultiValued)
|
||||||
|
{
|
||||||
|
this.isMultiValued = isMultiValued;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsMandatory()
|
||||||
|
{
|
||||||
|
return isMandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsMandatory(boolean isMandatory)
|
||||||
|
{
|
||||||
|
this.isMandatory = isMandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsMandatoryEnforced()
|
||||||
|
{
|
||||||
|
return isMandatoryEnforced;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsMandatoryEnforced(boolean isMandatoryEnforced)
|
||||||
|
{
|
||||||
|
this.isMandatoryEnforced = isMandatoryEnforced;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,5 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
public class RestTypeModel extends RestAbstractClassModel
|
||||||
|
{
|
||||||
|
}
|
@@ -0,0 +1,7 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.rest.core.RestModels;
|
||||||
|
|
||||||
|
public class RestTypesCollection extends RestModels<RestTypeModel, RestTypesCollection>
|
||||||
|
{
|
||||||
|
}
|
@@ -0,0 +1,71 @@
|
|||||||
|
package org.alfresco.rest.requests.modelAPI;
|
||||||
|
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import org.alfresco.rest.core.RestRequest;
|
||||||
|
import org.alfresco.rest.core.RestWrapper;
|
||||||
|
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||||
|
import org.alfresco.rest.model.*;
|
||||||
|
import org.alfresco.rest.requests.ModelRequest;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines the entire Rest Model API
|
||||||
|
* {@link https://api-explorer.alfresco.com/api-explorer/} select "Model API"
|
||||||
|
*/
|
||||||
|
public class RestModelAPI extends ModelRequest<RestModelAPI>
|
||||||
|
{
|
||||||
|
public RestModelAPI(RestWrapper restWrapper)
|
||||||
|
{
|
||||||
|
super(restWrapper);
|
||||||
|
RestAssured.basePath = "alfresco/api/-default-/public/alfresco/versions/1";
|
||||||
|
restWrapper.configureRequestSpec().setBasePath(RestAssured.basePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve all aspects using GET call on "aspects"
|
||||||
|
*
|
||||||
|
* @return RestAspectsCollection
|
||||||
|
* @throws JsonToModelConversionException
|
||||||
|
*/
|
||||||
|
public RestAspectsCollection getAspects()
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "aspects?{parameters}", restWrapper.getParameters());
|
||||||
|
return restWrapper.processModels(RestAspectsCollection.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve aspect by id using GET call on "aspects/{aspectId}"
|
||||||
|
*
|
||||||
|
* @return RestAspectModel
|
||||||
|
* @throws JsonToModelConversionException
|
||||||
|
*/
|
||||||
|
public RestAspectModel getAspect(String aspectId)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "aspects/{aspectId}?{parameters}", aspectId, restWrapper.getParameters());
|
||||||
|
return restWrapper.processModel(RestAspectModel.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve all types using GET call on "types"
|
||||||
|
*
|
||||||
|
* @return RestTypesCollection
|
||||||
|
* @throws JsonToModelConversionException
|
||||||
|
*/
|
||||||
|
public RestTypesCollection getTypes()
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "types?{parameters}", restWrapper.getParameters());
|
||||||
|
return restWrapper.processModels(RestTypesCollection.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve Type by id using GET call on "types/{typeId}"
|
||||||
|
*
|
||||||
|
* @return RestTypeModel
|
||||||
|
* @throws JsonToModelConversionException
|
||||||
|
*/
|
||||||
|
public RestTypeModel getType(String typeId)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "types/{typeId}?{parameters}", typeId, restWrapper.getParameters());
|
||||||
|
return restWrapper.processModel(RestTypeModel.class, request);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user