
com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultCustomerMaterialService 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.customermaterial.CustomerMaterial;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.customermaterial.CustomerMaterialByKeyFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.customermaterial.CustomerMaterialCreateFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.customermaterial.CustomerMaterialDeleteFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.customermaterial.CustomerMaterialFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.customermaterial.CustomerMaterialUpdateFluentHelper;
/**
*
* You can use this service to integrate external applications with customer material processing in SAP S/4HANA Cloud.
*
*
*
* Reference: SAP
* API Business Hub
*
* Details:
*
*
* OData Service:
* API_CUSTOMER_MATERIAL_SRV
*
*
* API Version:
* 1
*
*
* Communication Scenario:
* Customer Material Info Record Integration (SAP_COM_0134)
*
*
* Scope Items:
* Sell from Stock (BD9)
*
*
* Authentication Methods:
* Basic, x509
*
*
* Business Object:
* CustomerMaterial
*
*
*
*/
@Named( "com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultCustomerMaterialService" )
public class DefaultCustomerMaterialService implements CustomerMaterialService
{
@Nonnull
private final String servicePath;
/**
* Creates a service using {@link CustomerMaterialService#DEFAULT_SERVICE_PATH} to send the requests.
*
*/
public DefaultCustomerMaterialService()
{
servicePath = CustomerMaterialService.DEFAULT_SERVICE_PATH;
}
/**
* Creates a service using the provided service path to send the requests.
*
* Used by the fluent {@link #withServicePath(String)} method.
*
*/
private DefaultCustomerMaterialService( @Nonnull final String servicePath )
{
this.servicePath = servicePath;
}
@Override
@Nonnull
public DefaultCustomerMaterialService withServicePath( @Nonnull final String servicePath )
{
return new DefaultCustomerMaterialService(servicePath);
}
@Override
@Nonnull
public CustomerMaterialFluentHelper getAllCustomerMaterial()
{
return new CustomerMaterialFluentHelper(servicePath);
}
@Override
@Nonnull
public CustomerMaterialByKeyFluentHelper getCustomerMaterialByKey(
final String salesOrganization,
final String distributionChannel,
final String customer,
final String material )
{
return new CustomerMaterialByKeyFluentHelper(
servicePath,
salesOrganization,
distributionChannel,
customer,
material);
}
@Override
@Nonnull
public CustomerMaterialCreateFluentHelper createCustomerMaterial( @Nonnull final CustomerMaterial customerMaterial )
{
return new CustomerMaterialCreateFluentHelper(servicePath, customerMaterial);
}
@Override
@Nonnull
public CustomerMaterialUpdateFluentHelper updateCustomerMaterial( @Nonnull final CustomerMaterial customerMaterial )
{
return new CustomerMaterialUpdateFluentHelper(servicePath, customerMaterial);
}
@Override
@Nonnull
public CustomerMaterialDeleteFluentHelper deleteCustomerMaterial( @Nonnull final CustomerMaterial customerMaterial )
{
return new CustomerMaterialDeleteFluentHelper(servicePath, customerMaterial);
}
}