
com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultAttachmentService Maven / Gradle / Ivy
/*
* Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
*/
package com.sap.cloud.sdk.s4hana.datamodel.odata.services;
import javax.annotation.Nonnull;
import javax.inject.Named;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.attachment.AttachmentContent;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.attachment.AttachmentContentCreateFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.attachment.AttachmentContentDeleteFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.attachment.CreateUrlAsAttachmentFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.attachment.DocumentInfoRecordAttchByKeyFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.attachment.DocumentInfoRecordAttchFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.attachment.GetAllOriginalsFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.attachment.GetAttachmentCountFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.attachment.RenameAttachmentFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.attachment.batch.DefaultAttachmentServiceBatch;
/**
*
* This service enables you to manage Document Management (DMS), and Generic Object Services (GOS) based attachments,
* such as creating, reading, renaming, and deleting attachments. You can also read an existing document info record
* (DIR), and add attachments to it.
*
*
*
* Reference: SAP API
* Business Hub
*
* Details:
*
*
* OData Service:
* API_CV_ATTACHMENT_SRV
*
*
* API Version:
* 1
*
*
* Communication Scenario:
* Distributed Manufacturing Integration (SAP_COM_0077), Product Lifecycle Management - Master Data Integration
* (SAP_COM_0105), Finance - Posting Integration (SAP_COM_0002), Supplier Invoice Integration (SAP_COM_0057)
*
*
* Scope Items:
* Integration with SAP Distributed Manufacturing with SAP
* S/4HANA Cloud (1NX), Engineering Bill of Material - Versions
* Management (1NR), Engineering Bill of Material - Change
* Master Management (1R3), Accounting and Financial Close
* (J58), Service and Material Procurement - Project-Based
* Services (J13), Procurement of Direct Materials (J45),
* Consumable Purchasing (BNX)
*
*
* Authentication Methods:
* Basic, x509
*
*
*
*/
@Named( "com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultAttachmentService" )
public class DefaultAttachmentService implements AttachmentService
{
@Nonnull
private final String servicePath;
/**
* Creates a service using {@link AttachmentService#DEFAULT_SERVICE_PATH} to send the requests.
*
*/
public DefaultAttachmentService()
{
servicePath = AttachmentService.DEFAULT_SERVICE_PATH;
}
/**
* Creates a service using the provided service path to send the requests.
*
* Used by the fluent {@link #withServicePath(String)} method.
*
*/
private DefaultAttachmentService( @Nonnull final String servicePath )
{
this.servicePath = servicePath;
}
@Override
@Nonnull
public DefaultAttachmentService withServicePath( @Nonnull final String servicePath )
{
return new DefaultAttachmentService(servicePath);
}
/**
* {@inheritDoc}
*
*/
@Override
@Nonnull
public DefaultAttachmentServiceBatch batch()
{
return new DefaultAttachmentServiceBatch(this);
}
@Override
@Nonnull
public AttachmentContentCreateFluentHelper createAttachmentContent(
@Nonnull final AttachmentContent attachmentContent )
{
return new AttachmentContentCreateFluentHelper(servicePath, attachmentContent);
}
@Override
@Nonnull
public AttachmentContentDeleteFluentHelper deleteAttachmentContent(
@Nonnull final AttachmentContent attachmentContent )
{
return new AttachmentContentDeleteFluentHelper(servicePath, attachmentContent);
}
@Override
@Nonnull
public DocumentInfoRecordAttchFluentHelper getAllDocumentInfoRecordAttch()
{
return new DocumentInfoRecordAttchFluentHelper(servicePath);
}
@Override
@Nonnull
public DocumentInfoRecordAttchByKeyFluentHelper getDocumentInfoRecordAttchByKey(
final String documentInfoRecordDocType,
final String documentInfoRecordDocNumber,
final String documentInfoRecordDocVersion,
final String documentInfoRecordDocPart )
{
return new DocumentInfoRecordAttchByKeyFluentHelper(
servicePath,
documentInfoRecordDocType,
documentInfoRecordDocNumber,
documentInfoRecordDocVersion,
documentInfoRecordDocPart);
}
@Override
@Nonnull
public GetAllOriginalsFluentHelper getAllOriginals(
final String linkedSAPObjectKey,
final String businessObjectTypeName,
final String semanticObject )
{
return new GetAllOriginalsFluentHelper(servicePath, linkedSAPObjectKey, businessObjectTypeName, semanticObject);
}
@Override
@Nonnull
public GetAttachmentCountFluentHelper getAttachmentCount(
final String businessObjectTypeName,
final String linkedSAPObjectKey,
final String semanticObject )
{
return new GetAttachmentCountFluentHelper(
servicePath,
businessObjectTypeName,
linkedSAPObjectKey,
semanticObject);
}
@Override
@Nonnull
public RenameAttachmentFluentHelper renameAttachment(
final String documentInfoRecordDocType,
final String documentInfoRecordDocVersion,
final String logicalDocument,
final String archiveDocumentID,
final String businessObjectTypeName,
final String linkedSAPObjectKey,
final String semanticObject,
final String fileName,
final String documentInfoRecordDocNumber,
final String documentInfoRecordDocPart )
{
return new RenameAttachmentFluentHelper(
servicePath,
documentInfoRecordDocType,
documentInfoRecordDocVersion,
logicalDocument,
archiveDocumentID,
businessObjectTypeName,
linkedSAPObjectKey,
semanticObject,
fileName,
documentInfoRecordDocNumber,
documentInfoRecordDocPart);
}
@Override
@Nonnull
public CreateUrlAsAttachmentFluentHelper createUrlAsAttachment(
final String semanticObject,
final String linkedSAPObjectKey,
final String businessObjectTypeName,
final String url,
final String urlDescription,
final String mIMEType )
{
return new CreateUrlAsAttachmentFluentHelper(
servicePath,
semanticObject,
linkedSAPObjectKey,
businessObjectTypeName,
url,
urlDescription,
mIMEType);
}
}