activateDraft

open suspend fun activateDraft(entity: EntityValue): EntityValue

See activateDraft_(EntityValue, HttpHeaders, RequestOptions).

Return

(see linked method).

Parameters

entity

Entity parameter.


open suspend fun activateDraft(entity: EntityValue, headers: HttpHeaders): EntityValue

See activateDraft_(EntityValue, HttpHeaders, RequestOptions).

Return

(see linked method).

Parameters

entity

Entity parameter.

headers

Headers parameter.


open suspend fun activateDraft(entity: EntityValue, headers: HttpHeaders, options: RequestOptions): EntityValue

Activate a draft entity.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.DataServiceAsync#makeDraftCopy_(com.sap.cloud.mobile.kotlin.odata.EntityValue, com.sap.cloud.mobile.kotlin.odata.http.HttpHeaders, com.sap.cloud.mobile.kotlin.odata.RequestOptions) DataServiceAsync.makeDraftCopy}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#withCreate() EntityValue.withCreate}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#withUpdate() EntityValue.withUpdate}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#withDeepCreate(com.sap.cloud.mobile.kotlin.odata.PropertyPath...) EntityValue.withDeepCreate}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#withDeepUpdate(com.sap.cloud.mobile.kotlin.odata.PropertyPath...) EntityValue.withDeepUpdate}.

Example using proxy classes:
open fun activateDraftExample(): kotlin.Unit
{
    val service = this.healthService;
    var patient = Patient();
    patient.firstName = "Sherlock";
    patient.lastName = "Holmes";
    service.createEntity(patient.asDraft());
    // Upload pending requests, but not the draft patient.
    service.upload();
    // Associate a new draft appointment with the draft patient.
    val appointment = Appointment();
    appointment.purpose = "General Checkup";
    service.createRelatedEntity(appointment.asDraft(), patient,
        Patient.appointments);
    // Some time later... Activate the patient (and related appointments).
    patient = (service.activateDraft(patient.withDeepCreate(Patient.appointments)) as Patient);
    // Some time later... Upload the create of patient (and deep-created appointments).
    service.upload();
}

Return

Newly activated copy of the draft entity.

Parameters

entity

Draft entity.

headers

Optional request-specific headers.

options

Optional request-specific options.