/*
 * Copyright (c) 2014-2021, by Alex Leigh.
 * All rights reserved.
 *
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE
 * The copyright notice above does not evidence any
 * actual or intended publication of such source code.
 */

package leigh.tansu.sdk.v1.schema;

import leigh.eo.EO;

/**
 * This is a dynamically generated DAO class for accessing objects within an ESP graph. This class
 * has been generated by <code>DAOGenerator</code> and should not be modified.
 *
 * @author DAOGenerator (synthetically generated class)
 */
public final class ObjectGetRequestElementDAO {
    public static final String API_TYPE = "leigh.tansu.sdk.v1.ObjectGetRequest";

    public static EO create() {
        EO eo = new EO(API_TYPE);
        return eo;
    }

    public static boolean assertType(final EO eo) {
        return eo.getApiType().equals(API_TYPE);
    }

    public static final String KEY_BUCKETID = "bucketId";
    public static final String KEY_ID = "id";

    public static String apiType(final EO eo) {
        return eo.getApiType();
    }


    /* EO{typeName='org.a6v.esp.eo.schema.Field', data={apiName=bucketId, validators=EOLoop{array=[EO{typeName='org.a6v.esp.eo.schema.ValidatorNotEmpty', data={}, meta=null}]} , label=EOLoop{array=[EO{typeName='leigh.esp.eo.schema.Text', data={text=Bucket ID, locale=en}, meta=null}]} , type=string}, meta=null} */


    public static java.lang.String getBucketId(EO eo) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        return eo.getValueString(KEY_BUCKETID);
    }

    public static void setBucketId(final EO eo, java.lang.String value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValue(KEY_BUCKETID, value);
    }

    public static void setBucketIdLabel(final EO eo, final String label) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setLabel(KEY_BUCKETID, label);
    }

    public static void getLabelOrValueBucketId(final EO eo, java.lang.String value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.getLabelOrValue(KEY_BUCKETID);
    }

    public static void setIfUnsetBucketId(final EO eo, java.lang.String value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValueIfUnset(KEY_BUCKETID, value);
    }


    /* EO{typeName='org.a6v.esp.eo.schema.Field', data={apiName=id, validators=EOLoop{array=[EO{typeName='org.a6v.esp.eo.schema.ValidatorNotEmpty', data={}, meta=null}]} , label=EOLoop{array=[EO{typeName='leigh.esp.eo.schema.Text', data={text=Object ID, locale=en}, meta=null}]} , type=string}, meta=null} */


    public static java.lang.String getId(EO eo) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        return eo.getValueString(KEY_ID);
    }

    public static void setId(final EO eo, java.lang.String value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValue(KEY_ID, value);
    }

    public static void setIdLabel(final EO eo, final String label) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setLabel(KEY_ID, label);
    }

    public static void getLabelOrValueId(final EO eo, java.lang.String value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.getLabelOrValue(KEY_ID);
    }

    public static void setIfUnsetId(final EO eo, java.lang.String value) {
        if (!assertType(eo))
            throw new IllegalArgumentException("Mismatched EO type: [found: " + eo.getApiType() + "] [expected: " + API_TYPE + "]");
        eo.setValueIfUnset(KEY_ID, value);
}


}