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

com.linkedin.restli.common.multiplexer.MultiplexedRequestContent Maven / Gradle / Ivy


package com.linkedin.restli.common.multiplexer;

import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
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;


/**
 * Represents multiple HTTP requests to send as a single multiplexed HTTP request
 * 
 */
@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/common/multiplexer/MultiplexedRequestContent.pdsc.", date = "Tue Oct 03 15:15:24 PDT 2017")
public class MultiplexedRequestContent
    extends RecordTemplate
{

    private final static MultiplexedRequestContent.Fields _fields = new MultiplexedRequestContent.Fields();
    private final static RecordDataSchema SCHEMA = ((RecordDataSchema) DataTemplateUtil.parseSchema("{\"type\":\"record\",\"name\":\"MultiplexedRequestContent\",\"namespace\":\"com.linkedin.restli.common.multiplexer\",\"doc\":\"Represents multiple HTTP requests to send as a single multiplexed HTTP request\",\"fields\":[{\"name\":\"requests\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"IndividualRequest\",\"doc\":\"Individual HTTP request within a multiplexed request. For security reasons, cookies are not allowed to be specified in the IndividualRequest. Instead, it MUST be specified in the top level envelope request.\",\"fields\":[{\"name\":\"method\",\"type\":\"string\",\"doc\":\"HTTP method name\"},{\"name\":\"headers\",\"type\":{\"type\":\"map\",\"values\":\"string\"},\"doc\":\"HTTP headers specific to the individual request. All common headers should be specified in the top level envelope request. If IndividualRequest headers contain a header that is also specified in the top level envelope request, the header in the IndividualRequest will be used. In additions, for security reasons, headers in IndividualRequest are whitelisted. Only headers within the whitelist can be specified here.\",\"default\":{}},{\"name\":\"relativeUrl\",\"type\":\"string\",\"doc\":\"Relative URL of the request\"},{\"name\":\"body\",\"type\":{\"type\":\"record\",\"name\":\"IndividualBody\",\"doc\":\"Represents content that may be in the body of an individual request / response\",\"fields\":[]},\"doc\":\"Request body\",\"optional\":true},{\"name\":\"dependentRequests\",\"type\":{\"type\":\"map\",\"values\":\"IndividualRequest\"},\"doc\":\"Requests that should be executed after the current request is processed (sequential ordering). Dependent requests are executed in parallel. Keys of the dependent requests are used to correlate responses with requests. They should be unique within the multiplexed request\",\"default\":{}}]}},\"doc\":\"Individual HTTP requests executed in parallel.  Keys of the requests are used to correlate responses with requests. They should be unique within the multiplexed request\"}]}"));
    private final static RecordDataSchema.Field FIELD_Requests = SCHEMA.getField("requests");

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

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

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

    /**
     * Existence checker for requests
     * 
     * @see MultiplexedRequestContent.Fields#requests
     */
    public boolean hasRequests() {
        return contains(FIELD_Requests);
    }

    /**
     * Remover for requests
     * 
     * @see MultiplexedRequestContent.Fields#requests
     */
    public void removeRequests() {
        remove(FIELD_Requests);
    }

    /**
     * Getter for requests
     * 
     * @see MultiplexedRequestContent.Fields#requests
     */
    public IndividualRequestMap getRequests(GetMode mode) {
        return obtainWrapped(FIELD_Requests, IndividualRequestMap.class, mode);
    }

    /**
     * Getter for requests
     * 
     * @return
     *     Required field. Could be null for partial record.
     * @see MultiplexedRequestContent.Fields#requests
     */
    @Nonnull
    public IndividualRequestMap getRequests() {
        return obtainWrapped(FIELD_Requests, IndividualRequestMap.class, GetMode.STRICT);
    }

    /**
     * Setter for requests
     * 
     * @see MultiplexedRequestContent.Fields#requests
     */
    public MultiplexedRequestContent setRequests(IndividualRequestMap value, SetMode mode) {
        putWrapped(FIELD_Requests, IndividualRequestMap.class, value, mode);
        return this;
    }

    /**
     * Setter for requests
     * 
     * @param value
     *     Must not be null. For more control, use setters with mode instead.
     * @see MultiplexedRequestContent.Fields#requests
     */
    public MultiplexedRequestContent setRequests(
        @Nonnull
        IndividualRequestMap value) {
        putWrapped(FIELD_Requests, IndividualRequestMap.class, value, SetMode.DISALLOW_NULL);
        return this;
    }

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

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

    public static class Fields
        extends PathSpec
    {


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

        public Fields() {
            super();
        }

        /**
         * Individual HTTP requests executed in parallel.  Keys of the requests are used to correlate responses with requests. They should be unique within the multiplexed request
         * 
         */
        public com.linkedin.restli.common.multiplexer.IndividualRequestMap.Fields requests() {
            return new com.linkedin.restli.common.multiplexer.IndividualRequestMap.Fields(getPathComponents(), "requests");
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy