
com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultDefectProcessingService 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.defectprocessing.Defect;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.defectprocessing.DefectByKeyFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.defectprocessing.DefectCreateFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.defectprocessing.DefectDeleteFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.defectprocessing.DefectFluentHelper;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.defectprocessing.DefectUpdateFluentHelper;
/**
*
* This service enables you to create, read, update, and delete defects that are not assigned to a quality notification.
* A defect is a deviation due to which a requirement cannot be fulfilled (for example, encountered during a quality
* inspection).
*
*
*
* Reference:
* SAP
* API Business Hub
*
* Details:
*
*
* OData Service:
* API_DEFECT_SRV
*
*
* API Version:
* 1
*
*
* Communication Scenario:
* Defect Processing Integration (SAP_COM_0153)
*
*
* Scope Items:
* Quality Management in Discrete Manufacturing (1E1),
* Quality Management in Procurement (1FM),
* Quality Management in Sales (1MP),
* Quality Management in Stock Handling (1MR),
* Nonconformance Management (2QN)
*
*
* Authentication Methods:
* Basic, x509, OAuth2
*
*
* Business Object:
* Defect
*
*
*
*/
@Named( "com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultDefectProcessingService" )
public class DefaultDefectProcessingService implements DefectProcessingService
{
@Nonnull
private final String servicePath;
/**
* Creates a service using {@link DefectProcessingService#DEFAULT_SERVICE_PATH} to send the requests.
*
*/
public DefaultDefectProcessingService()
{
servicePath = DefectProcessingService.DEFAULT_SERVICE_PATH;
}
/**
* Creates a service using the provided service path to send the requests.
*
* Used by the fluent {@link #withServicePath(String)} method.
*
*/
private DefaultDefectProcessingService( @Nonnull final String servicePath )
{
this.servicePath = servicePath;
}
@Override
@Nonnull
public DefaultDefectProcessingService withServicePath( @Nonnull final String servicePath )
{
return new DefaultDefectProcessingService(servicePath);
}
@Override
@Nonnull
public DefectFluentHelper getAllDefect()
{
return new DefectFluentHelper(servicePath);
}
@Override
@Nonnull
public DefectByKeyFluentHelper getDefectByKey( final String defectInternalID )
{
return new DefectByKeyFluentHelper(servicePath, defectInternalID);
}
@Override
@Nonnull
public DefectCreateFluentHelper createDefect( @Nonnull final Defect defect )
{
return new DefectCreateFluentHelper(servicePath, defect);
}
@Override
@Nonnull
public DefectUpdateFluentHelper updateDefect( @Nonnull final Defect defect )
{
return new DefectUpdateFluentHelper(servicePath, defect);
}
@Override
@Nonnull
public DefectDeleteFluentHelper deleteDefect( @Nonnull final Defect defect )
{
return new DefectDeleteFluentHelper(servicePath, defect);
}
}