
com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultBatchService 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.batch.Batch;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchByKeyFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchCharcByKeyFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchCharcFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchCharcValueByKeyFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchCharcValueFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchClassByKeyFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchClassFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchCreateFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchPlant;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchPlantByKeyFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchPlantFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchPlantUpdateFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.batch.BatchUpdateFluentHelper;
/**
*
* This service enables you to create, change and read batches. The service is based on the OData protocol, and can be
* consumed by external systems and user interfaces.
*
*
*
* Reference:
* SAP API
* Business Hub
*
* Details:
*
*
* OData Service:
* API_BATCH_SRV
*
*
* API Version:
* 1
*
*
* Communication Scenario:
* Batch Management OData Integration (SAP_COM_0337)
*
*
* Scope Items:
* Batch Management (BLF)
*
*
* Authentication Methods:
* Basic, x509, OAuth2
*
*
*
*/
@Named( "com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultBatchService" )
public class DefaultBatchService implements BatchService
{
@Nonnull
private final String servicePath;
/**
* Creates a service using {@link BatchService#DEFAULT_SERVICE_PATH} to send the requests.
*
*/
public DefaultBatchService()
{
servicePath = BatchService.DEFAULT_SERVICE_PATH;
}
/**
* Creates a service using the provided service path to send the requests.
*
* Used by the fluent {@link #withServicePath(String)} method.
*
*/
private DefaultBatchService( @Nonnull final String servicePath )
{
this.servicePath = servicePath;
}
@Override
@Nonnull
public DefaultBatchService withServicePath( @Nonnull final String servicePath )
{
return new DefaultBatchService(servicePath);
}
@Override
@Nonnull
public BatchFluentHelper getAllBatch()
{
return new BatchFluentHelper(servicePath);
}
@Override
@Nonnull
public
BatchByKeyFluentHelper
getBatchByKey( final String material, final String batchIdentifyingPlant, final String batch )
{
return new BatchByKeyFluentHelper(servicePath, material, batchIdentifyingPlant, batch);
}
@Override
@Nonnull
public BatchCreateFluentHelper createBatch( @Nonnull final Batch batch )
{
return new BatchCreateFluentHelper(servicePath, batch);
}
@Override
@Nonnull
public BatchUpdateFluentHelper updateBatch( @Nonnull final Batch batch )
{
return new BatchUpdateFluentHelper(servicePath, batch);
}
@Override
@Nonnull
public BatchCharcFluentHelper getAllBatchCharc()
{
return new BatchCharcFluentHelper(servicePath);
}
@Override
@Nonnull
public BatchCharcByKeyFluentHelper getBatchCharcByKey(
final String material,
final String batchIdentifyingPlant,
final String batch,
final String charcInternalID )
{
return new BatchCharcByKeyFluentHelper(servicePath, material, batchIdentifyingPlant, batch, charcInternalID);
}
@Override
@Nonnull
public BatchCharcValueFluentHelper getAllBatchCharcValue()
{
return new BatchCharcValueFluentHelper(servicePath);
}
@Override
@Nonnull
public BatchCharcValueByKeyFluentHelper getBatchCharcValueByKey(
final String material,
final String batchIdentifyingPlant,
final String batch,
final String charcInternalID,
final String charcValuePositionNumber )
{
return new BatchCharcValueByKeyFluentHelper(
servicePath,
material,
batchIdentifyingPlant,
batch,
charcInternalID,
charcValuePositionNumber);
}
@Override
@Nonnull
public BatchClassFluentHelper getAllBatchClass()
{
return new BatchClassFluentHelper(servicePath);
}
@Override
@Nonnull
public
BatchClassByKeyFluentHelper
getBatchClassByKey( final String material, final String batchIdentifyingPlant, final String batch )
{
return new BatchClassByKeyFluentHelper(servicePath, material, batchIdentifyingPlant, batch);
}
@Override
@Nonnull
public BatchPlantFluentHelper getAllBatchPlant()
{
return new BatchPlantFluentHelper(servicePath);
}
@Override
@Nonnull
public
BatchPlantByKeyFluentHelper
getBatchPlantByKey( final String material, final String batch, final String plant )
{
return new BatchPlantByKeyFluentHelper(servicePath, material, batch, plant);
}
@Override
@Nonnull
public BatchPlantUpdateFluentHelper updateBatchPlant( @Nonnull final BatchPlant batchPlant )
{
return new BatchPlantUpdateFluentHelper(servicePath, batchPlant);
}
}