/** * This code was auto-generated by a Codezu. * * Changes to this file may cause incorrect behavior and will be lost if * the code is regenerated. */ package com.mozu.api.resources.content; import com.mozu.api.ApiContext; import java.util.List; import java.util.ArrayList; import com.mozu.api.MozuClient; import com.mozu.api.MozuClientFactory; import com.mozu.api.MozuUrl; import com.mozu.api.Headers; import org.joda.time.DateTime; import com.mozu.api.security.AuthTicket; import org.apache.commons.lang.StringUtils; import com.mozu.api.DataViewMode; /** <summary> * Use the Document Types resource to view the document types supplied by the Content API. * </summary> */ public class DocumentTypeResource { /// /// <see cref="Mozu.Api.ApiContext"/> /// private ApiContext _apiContext; private DataViewMode _dataViewMode; public DocumentTypeResource(ApiContext apiContext) { _apiContext = apiContext; _dataViewMode = DataViewMode.Live; } public DocumentTypeResource(ApiContext apiContext, DataViewMode dataViewMode) { _apiContext = apiContext; _dataViewMode = dataViewMode; } /** * Retrieves a paged list of the system-defined document types. * <p><pre><code> * DocumentType documenttype = new DocumentType(); * DocumentTypeCollection documentTypeCollection = documenttype.getDocumentTypes(); * </code></pre></p> * @return com.mozu.api.contracts.content.DocumentTypeCollection * @see com.mozu.api.contracts.content.DocumentTypeCollection */ public com.mozu.api.contracts.content.DocumentTypeCollection getDocumentTypes() throws Exception { return getDocumentTypes( null, null, null); } /** * Retrieves a paged list of the system-defined document types. * <p><pre><code> * DocumentType documenttype = new DocumentType(); * DocumentTypeCollection documentTypeCollection = documenttype.getDocumentTypes( pageSize, startIndex, responseFields); * </code></pre></p> * @param pageSize The number of results to display on each page when creating paged results from a query. The maximum value is 200. * @param responseFields Use this field to include those fields which are not included by default. * @param startIndex When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with a PageSize of 25, to get the 51st through the 75th items, use startIndex=3. * @return com.mozu.api.contracts.content.DocumentTypeCollection * @see com.mozu.api.contracts.content.DocumentTypeCollection */ public com.mozu.api.contracts.content.DocumentTypeCollection getDocumentTypes(Integer pageSize, Integer startIndex, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.content.DocumentTypeCollection> client = com.mozu.api.clients.content.DocumentTypeClient.getDocumentTypesClient(_dataViewMode, pageSize, startIndex, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Retrieves a system-defined document type. * <p><pre><code> * DocumentType documenttype = new DocumentType(); * DocumentType documentType = documenttype.getDocumentType( documentTypeName); * </code></pre></p> * @param documentTypeName The name of the document type to retrieve. * @return com.mozu.api.contracts.content.DocumentType * @see com.mozu.api.contracts.content.DocumentType */ public com.mozu.api.contracts.content.DocumentType getDocumentType(String documentTypeName) throws Exception { return getDocumentType( documentTypeName, null); } /** * Retrieves a system-defined document type. * <p><pre><code> * DocumentType documenttype = new DocumentType(); * DocumentType documentType = documenttype.getDocumentType( documentTypeName, responseFields); * </code></pre></p> * @param documentTypeName The name of the document type to retrieve. * @param responseFields Use this field to include those fields which are not included by default. * @return com.mozu.api.contracts.content.DocumentType * @see com.mozu.api.contracts.content.DocumentType */ public com.mozu.api.contracts.content.DocumentType getDocumentType(String documentTypeName, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.content.DocumentType> client = com.mozu.api.clients.content.DocumentTypeClient.getDocumentTypeClient(_dataViewMode, documentTypeName, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Creates a new DocumentType * <p><pre><code> * DocumentType documenttype = new DocumentType(); * DocumentType documentType = documenttype.createDocumentType( documentType); * </code></pre></p> * @param documentType The type of documents used in the CMS such as "web_page" or "template" or "image_url". * @return com.mozu.api.contracts.content.DocumentType * @see com.mozu.api.contracts.content.DocumentType * @see com.mozu.api.contracts.content.DocumentType */ public com.mozu.api.contracts.content.DocumentType createDocumentType(com.mozu.api.contracts.content.DocumentType documentType) throws Exception { return createDocumentType( documentType, null); } /** * Creates a new DocumentType * <p><pre><code> * DocumentType documenttype = new DocumentType(); * DocumentType documentType = documenttype.createDocumentType( documentType, responseFields); * </code></pre></p> * @param responseFields Use this field to include those fields which are not included by default. * @param documentType The type of documents used in the CMS such as "web_page" or "template" or "image_url". * @return com.mozu.api.contracts.content.DocumentType * @see com.mozu.api.contracts.content.DocumentType * @see com.mozu.api.contracts.content.DocumentType */ public com.mozu.api.contracts.content.DocumentType createDocumentType(com.mozu.api.contracts.content.DocumentType documentType, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.content.DocumentType> client = com.mozu.api.clients.content.DocumentTypeClient.createDocumentTypeClient(_dataViewMode, documentType, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } /** * Updates a DocumentType * <p><pre><code> * DocumentType documenttype = new DocumentType(); * DocumentType documentType = documenttype.updateDocumentType( documentType, documentTypeName); * </code></pre></p> * @param documentTypeName The name of the document type to retrieve. * @param documentType The type of documents used in the CMS such as "web_page" or "template" or "image_url". * @return com.mozu.api.contracts.content.DocumentType * @see com.mozu.api.contracts.content.DocumentType * @see com.mozu.api.contracts.content.DocumentType */ public com.mozu.api.contracts.content.DocumentType updateDocumentType(com.mozu.api.contracts.content.DocumentType documentType, String documentTypeName) throws Exception { return updateDocumentType( documentType, documentTypeName, null); } /** * Updates a DocumentType * <p><pre><code> * DocumentType documenttype = new DocumentType(); * DocumentType documentType = documenttype.updateDocumentType( documentType, documentTypeName, responseFields); * </code></pre></p> * @param documentTypeName The name of the document type to retrieve. * @param responseFields Use this field to include those fields which are not included by default. * @param documentType The type of documents used in the CMS such as "web_page" or "template" or "image_url". * @return com.mozu.api.contracts.content.DocumentType * @see com.mozu.api.contracts.content.DocumentType * @see com.mozu.api.contracts.content.DocumentType */ public com.mozu.api.contracts.content.DocumentType updateDocumentType(com.mozu.api.contracts.content.DocumentType documentType, String documentTypeName, String responseFields) throws Exception { MozuClient<com.mozu.api.contracts.content.DocumentType> client = com.mozu.api.clients.content.DocumentTypeClient.updateDocumentTypeClient( documentType, documentTypeName, responseFields); client.setContext(_apiContext); client.executeRequest(); return client.getResult(); } }