All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.linkedin.restli.restspec.RestMethodSchema Maven / Gradle / Ivy


package com.linkedin.restli.restspec;

import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.linkedin.data.DataMap;
import com.linkedin.data.schema.PathSpec;
import com.linkedin.data.schema.RecordDataSchema;
import com.linkedin.data.template.DataTemplateUtil;
import com.linkedin.data.template.GetMode;
import com.linkedin.data.template.RecordTemplate;
import com.linkedin.data.template.SetMode;


/**
 * 
 * 
 */
@Generated(value = "com.linkedin.pegasus.generator.JavaCodeUtil", comments = "Rest.li Data Template. Generated from /Users/mnchen/dev/pegasus_trunk/pegasus/restli-common/src/main/pegasus/com/linkedin/restli/restspec/RestMethodSchema.pdsc.", date = "Tue Oct 03 15:15:24 PDT 2017")
public class RestMethodSchema
    extends RecordTemplate
{

    private final static RestMethodSchema.Fields _fields = new RestMethodSchema.Fields();
    private final static RecordDataSchema SCHEMA = ((RecordDataSchema) DataTemplateUtil.parseSchema("{\"type\":\"record\",\"name\":\"RestMethodSchema\",\"namespace\":\"com.linkedin.restli.restspec\",\"include\":[{\"type\":\"record\",\"name\":\"CustomAnnotationSchema\",\"doc\":\"Custom annotation for idl\",\"fields\":[{\"name\":\"annotations\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"CustomAnnotationContentSchema\",\"doc\":\"Unstructured record that represents arbitrary custom annotations for idl. Actual content is always a map with annotation's overridable member name as key and member value as value\",\"fields\":[]}},\"doc\":\"custom annotation data\",\"optional\":true}]}],\"fields\":[{\"name\":\"method\",\"type\":\"string\",\"doc\":\"Method type for this rest method\"},{\"name\":\"doc\",\"type\":\"string\",\"doc\":\"Documentation for this rest method\",\"optional\":true},{\"name\":\"parameters\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"ParameterSchema\",\"include\":[\"CustomAnnotationSchema\"],\"fields\":[{\"name\":\"name\",\"type\":\"string\",\"doc\":\"name of this parameter\"},{\"name\":\"type\",\"type\":\"string\",\"doc\":\"avro type of this parameter\"},{\"name\":\"items\",\"type\":\"string\",\"doc\":\"type of individual items, if this is an array parameter (used for finder parameters)\",\"optional\":true},{\"name\":\"optional\",\"type\":\"boolean\",\"doc\":\"indicates whether this parameter is optional.  omitted for required parameters\",\"optional\":true},{\"name\":\"default\",\"type\":\"string\",\"doc\":\"indicates the default value for this parameter\",\"optional\":true},{\"name\":\"doc\",\"type\":\"string\",\"doc\":\"Documentation for this parameter\",\"optional\":true}]}},\"doc\":\"list of query parameters for this method\",\"optional\":true},{\"name\":\"metadata\",\"type\":{\"type\":\"record\",\"name\":\"MetadataSchema\",\"fields\":[{\"name\":\"type\",\"type\":\"string\",\"doc\":\"pegasus type of the metadata\"}]},\"doc\":\"Describes the collection level metadata returned by this method. This is usually set only for GET_ALL method type.\",\"optional\":true},{\"name\":\"pagingSupported\",\"type\":\"boolean\",\"doc\":\"Indicates if this rest method has paging support using the start and count parameters\",\"optional\":true}]}"));
    private final static RecordDataSchema.Field FIELD_Annotations = SCHEMA.getField("annotations");
    private final static RecordDataSchema.Field FIELD_Method = SCHEMA.getField("method");
    private final static RecordDataSchema.Field FIELD_Doc = SCHEMA.getField("doc");
    private final static RecordDataSchema.Field FIELD_Parameters = SCHEMA.getField("parameters");
    private final static RecordDataSchema.Field FIELD_Metadata = SCHEMA.getField("metadata");
    private final static RecordDataSchema.Field FIELD_PagingSupported = SCHEMA.getField("pagingSupported");

    public RestMethodSchema() {
        super(new DataMap(), SCHEMA);
    }

    public RestMethodSchema(DataMap data) {
        super(data, SCHEMA);
    }

    public static RestMethodSchema.Fields fields() {
        return _fields;
    }

    /**
     * Existence checker for annotations
     * 
     * @see RestMethodSchema.Fields#annotations
     */
    public boolean hasAnnotations() {
        return contains(FIELD_Annotations);
    }

    /**
     * Remover for annotations
     * 
     * @see RestMethodSchema.Fields#annotations
     */
    public void removeAnnotations() {
        remove(FIELD_Annotations);
    }

    /**
     * Getter for annotations
     * 
     * @see RestMethodSchema.Fields#annotations
     */
    public CustomAnnotationContentSchemaMap getAnnotations(GetMode mode) {
        return obtainWrapped(FIELD_Annotations, CustomAnnotationContentSchemaMap.class, mode);
    }

    /**
     * Getter for annotations
     * 
     * @return
     *     Optional field. Always check for null.
     * @see RestMethodSchema.Fields#annotations
     */
    @Nullable
    public CustomAnnotationContentSchemaMap getAnnotations() {
        return obtainWrapped(FIELD_Annotations, CustomAnnotationContentSchemaMap.class, GetMode.STRICT);
    }

    /**
     * Setter for annotations
     * 
     * @see RestMethodSchema.Fields#annotations
     */
    public RestMethodSchema setAnnotations(CustomAnnotationContentSchemaMap value, SetMode mode) {
        putWrapped(FIELD_Annotations, CustomAnnotationContentSchemaMap.class, value, mode);
        return this;
    }

    /**
     * Setter for annotations
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see RestMethodSchema.Fields#annotations
     */
    public RestMethodSchema setAnnotations(
        @Nonnull
        CustomAnnotationContentSchemaMap value) {
        putWrapped(FIELD_Annotations, CustomAnnotationContentSchemaMap.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Existence checker for method
     * 
     * @see RestMethodSchema.Fields#method
     */
    public boolean hasMethod() {
        return contains(FIELD_Method);
    }

    /**
     * Remover for method
     * 
     * @see RestMethodSchema.Fields#method
     */
    public void removeMethod() {
        remove(FIELD_Method);
    }

    /**
     * Getter for method
     * 
     * @see RestMethodSchema.Fields#method
     */
    public String getMethod(GetMode mode) {
        return obtainDirect(FIELD_Method, String.class, mode);
    }

    /**
     * Getter for method
     * 
     * @return
     *     Required field. Could be null for partial record.
     * @see RestMethodSchema.Fields#method
     */
    @Nonnull
    public String getMethod() {
        return obtainDirect(FIELD_Method, String.class, GetMode.STRICT);
    }

    /**
     * Setter for method
     * 
     * @see RestMethodSchema.Fields#method
     */
    public RestMethodSchema setMethod(String value, SetMode mode) {
        putDirect(FIELD_Method, String.class, String.class, value, mode);
        return this;
    }

    /**
     * Setter for method
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see RestMethodSchema.Fields#method
     */
    public RestMethodSchema setMethod(
        @Nonnull
        String value) {
        putDirect(FIELD_Method, String.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Existence checker for doc
     * 
     * @see RestMethodSchema.Fields#doc
     */
    public boolean hasDoc() {
        return contains(FIELD_Doc);
    }

    /**
     * Remover for doc
     * 
     * @see RestMethodSchema.Fields#doc
     */
    public void removeDoc() {
        remove(FIELD_Doc);
    }

    /**
     * Getter for doc
     * 
     * @see RestMethodSchema.Fields#doc
     */
    public String getDoc(GetMode mode) {
        return obtainDirect(FIELD_Doc, String.class, mode);
    }

    /**
     * Getter for doc
     * 
     * @return
     *     Optional field. Always check for null.
     * @see RestMethodSchema.Fields#doc
     */
    @Nullable
    public String getDoc() {
        return obtainDirect(FIELD_Doc, String.class, GetMode.STRICT);
    }

    /**
     * Setter for doc
     * 
     * @see RestMethodSchema.Fields#doc
     */
    public RestMethodSchema setDoc(String value, SetMode mode) {
        putDirect(FIELD_Doc, String.class, String.class, value, mode);
        return this;
    }

    /**
     * Setter for doc
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see RestMethodSchema.Fields#doc
     */
    public RestMethodSchema setDoc(
        @Nonnull
        String value) {
        putDirect(FIELD_Doc, String.class, String.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Existence checker for parameters
     * 
     * @see RestMethodSchema.Fields#parameters
     */
    public boolean hasParameters() {
        return contains(FIELD_Parameters);
    }

    /**
     * Remover for parameters
     * 
     * @see RestMethodSchema.Fields#parameters
     */
    public void removeParameters() {
        remove(FIELD_Parameters);
    }

    /**
     * Getter for parameters
     * 
     * @see RestMethodSchema.Fields#parameters
     */
    public ParameterSchemaArray getParameters(GetMode mode) {
        return obtainWrapped(FIELD_Parameters, ParameterSchemaArray.class, mode);
    }

    /**
     * Getter for parameters
     * 
     * @return
     *     Optional field. Always check for null.
     * @see RestMethodSchema.Fields#parameters
     */
    @Nullable
    public ParameterSchemaArray getParameters() {
        return obtainWrapped(FIELD_Parameters, ParameterSchemaArray.class, GetMode.STRICT);
    }

    /**
     * Setter for parameters
     * 
     * @see RestMethodSchema.Fields#parameters
     */
    public RestMethodSchema setParameters(ParameterSchemaArray value, SetMode mode) {
        putWrapped(FIELD_Parameters, ParameterSchemaArray.class, value, mode);
        return this;
    }

    /**
     * Setter for parameters
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see RestMethodSchema.Fields#parameters
     */
    public RestMethodSchema setParameters(
        @Nonnull
        ParameterSchemaArray value) {
        putWrapped(FIELD_Parameters, ParameterSchemaArray.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Existence checker for metadata
     * 
     * @see RestMethodSchema.Fields#metadata
     */
    public boolean hasMetadata() {
        return contains(FIELD_Metadata);
    }

    /**
     * Remover for metadata
     * 
     * @see RestMethodSchema.Fields#metadata
     */
    public void removeMetadata() {
        remove(FIELD_Metadata);
    }

    /**
     * Getter for metadata
     * 
     * @see RestMethodSchema.Fields#metadata
     */
    public MetadataSchema getMetadata(GetMode mode) {
        return obtainWrapped(FIELD_Metadata, MetadataSchema.class, mode);
    }

    /**
     * Getter for metadata
     * 
     * @return
     *     Optional field. Always check for null.
     * @see RestMethodSchema.Fields#metadata
     */
    @Nullable
    public MetadataSchema getMetadata() {
        return obtainWrapped(FIELD_Metadata, MetadataSchema.class, GetMode.STRICT);
    }

    /**
     * Setter for metadata
     * 
     * @see RestMethodSchema.Fields#metadata
     */
    public RestMethodSchema setMetadata(MetadataSchema value, SetMode mode) {
        putWrapped(FIELD_Metadata, MetadataSchema.class, value, mode);
        return this;
    }

    /**
     * Setter for metadata
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see RestMethodSchema.Fields#metadata
     */
    public RestMethodSchema setMetadata(
        @Nonnull
        MetadataSchema value) {
        putWrapped(FIELD_Metadata, MetadataSchema.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Existence checker for pagingSupported
     * 
     * @see RestMethodSchema.Fields#pagingSupported
     */
    public boolean hasPagingSupported() {
        return contains(FIELD_PagingSupported);
    }

    /**
     * Remover for pagingSupported
     * 
     * @see RestMethodSchema.Fields#pagingSupported
     */
    public void removePagingSupported() {
        remove(FIELD_PagingSupported);
    }

    /**
     * Getter for pagingSupported
     * 
     * @see RestMethodSchema.Fields#pagingSupported
     */
    public Boolean isPagingSupported(GetMode mode) {
        return obtainDirect(FIELD_PagingSupported, Boolean.class, mode);
    }

    /**
     * Getter for pagingSupported
     * 
     * @return
     *     Optional field. Always check for null.
     * @see RestMethodSchema.Fields#pagingSupported
     */
    @Nullable
    public Boolean isPagingSupported() {
        return obtainDirect(FIELD_PagingSupported, Boolean.class, GetMode.STRICT);
    }

    /**
     * Setter for pagingSupported
     * 
     * @see RestMethodSchema.Fields#pagingSupported
     */
    public RestMethodSchema setPagingSupported(Boolean value, SetMode mode) {
        putDirect(FIELD_PagingSupported, Boolean.class, Boolean.class, value, mode);
        return this;
    }

    /**
     * Setter for pagingSupported
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see RestMethodSchema.Fields#pagingSupported
     */
    public RestMethodSchema setPagingSupported(
        @Nonnull
        Boolean value) {
        putDirect(FIELD_PagingSupported, Boolean.class, Boolean.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    /**
     * Setter for pagingSupported
     * 
     * @see RestMethodSchema.Fields#pagingSupported
     */
    public RestMethodSchema setPagingSupported(boolean value) {
        putDirect(FIELD_PagingSupported, Boolean.class, Boolean.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

    @Override
    public RestMethodSchema clone()
        throws CloneNotSupportedException
    {
        return ((RestMethodSchema) super.clone());
    }

    @Override
    public RestMethodSchema copy()
        throws CloneNotSupportedException
    {
        return ((RestMethodSchema) super.copy());
    }

    public static class Fields
        extends PathSpec
    {


        public Fields(List path, String name) {
            super(path, name);
        }

        public Fields() {
            super();
        }

        /**
         * custom annotation data
         * 
         */
        public com.linkedin.restli.restspec.CustomAnnotationContentSchemaMap.Fields annotations() {
            return new com.linkedin.restli.restspec.CustomAnnotationContentSchemaMap.Fields(getPathComponents(), "annotations");
        }

        /**
         * Method type for this rest method
         * 
         */
        public PathSpec method() {
            return new PathSpec(getPathComponents(), "method");
        }

        /**
         * Documentation for this rest method
         * 
         */
        public PathSpec doc() {
            return new PathSpec(getPathComponents(), "doc");
        }

        /**
         * list of query parameters for this method
         * 
         */
        public com.linkedin.restli.restspec.ParameterSchemaArray.Fields parameters() {
            return new com.linkedin.restli.restspec.ParameterSchemaArray.Fields(getPathComponents(), "parameters");
        }

        /**
         * Describes the collection level metadata returned by this method. This is usually set only for GET_ALL method type.
         * 
         */
        public com.linkedin.restli.restspec.MetadataSchema.Fields metadata() {
            return new com.linkedin.restli.restspec.MetadataSchema.Fields(getPathComponents(), "metadata");
        }

        /**
         * Indicates if this rest method has paging support using the start and count parameters
         * 
         */
        public PathSpec pagingSupported() {
            return new PathSpec(getPathComponents(), "pagingSupported");
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy