
com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultPurchasingSourceService 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.purchasingsource.PurchasingSource;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.purchasingsource.PurchasingSourceByKeyFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.purchasingsource.PurchasingSourceCreateFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.purchasingsource.PurchasingSourceDeleteFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.purchasingsource.PurchasingSourceFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.purchasingsource.PurchasingSourceUpdateFluentHelper;
/**
*
* This services enables a remote system to read, create and update purchasing sources from / in the SAP S/4HANA tenant.
*
*
*
* Reference: SAP
* API Business Hub
*
* Details:
*
*
* OData Service:
* API_PURCHASING_SOURCE_SRV
*
*
* API Version:
* 1
*
*
* Communication Scenario:
* Purchasing Source Integration (SAP_COM_0162)
*
*
* Scope Items:
* Purchase Contract (BMD)
*
*
*
*/
@Named( "com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultPurchasingSourceService" )
public class DefaultPurchasingSourceService implements PurchasingSourceService
{
@Nonnull
private final String servicePath;
/**
* Creates a service using {@link PurchasingSourceService#DEFAULT_SERVICE_PATH} to send the requests.
*
*/
public DefaultPurchasingSourceService()
{
servicePath = PurchasingSourceService.DEFAULT_SERVICE_PATH;
}
/**
* Creates a service using the provided service path to send the requests.
*
* Used by the fluent {@link #withServicePath(String)} method.
*
*/
private DefaultPurchasingSourceService( @Nonnull final String servicePath )
{
this.servicePath = servicePath;
}
@Override
@Nonnull
public DefaultPurchasingSourceService withServicePath( @Nonnull final String servicePath )
{
return new DefaultPurchasingSourceService(servicePath);
}
@Override
@Nonnull
public PurchasingSourceFluentHelper getAllPurchasingSource()
{
return new PurchasingSourceFluentHelper(servicePath);
}
@Override
@Nonnull
public
PurchasingSourceByKeyFluentHelper
getPurchasingSourceByKey( final String material, final String plant, final String sourceListRecord )
{
return new PurchasingSourceByKeyFluentHelper(servicePath, material, plant, sourceListRecord);
}
@Override
@Nonnull
public PurchasingSourceCreateFluentHelper createPurchasingSource( @Nonnull final PurchasingSource purchasingSource )
{
return new PurchasingSourceCreateFluentHelper(servicePath, purchasingSource);
}
@Override
@Nonnull
public PurchasingSourceUpdateFluentHelper updatePurchasingSource( @Nonnull final PurchasingSource purchasingSource )
{
return new PurchasingSourceUpdateFluentHelper(servicePath, purchasingSource);
}
@Override
@Nonnull
public PurchasingSourceDeleteFluentHelper deletePurchasingSource( @Nonnull final PurchasingSource purchasingSource )
{
return new PurchasingSourceDeleteFluentHelper(servicePath, purchasingSource);
}
}