package com.rollbar.payload;

import com.rollbar.payload.data.Data;
import com.rollbar.payload.utilities.ArgumentNullException;
import com.rollbar.payload.utilities.Validate;

public final class Payload {
    private final String accessToken;
    private final Data data;

    public Payload(String accessToken, Data data) throws ArgumentNullException {
        Validate.isNotNullOrWhitespace(accessToken, "accessToken");
        this.accessToken = accessToken;

        Validate.isNotNull(data, "data");
        this.data = data;
    }

    public String accessToken() {
        return accessToken;
    }

    public Data data() {
        return data;
    }

    public Payload accessToken(String token) throws ArgumentNullException {
        return new Payload(token, this.data);
    }

    public Payload data(Data data) throws ArgumentNullException {
        return new Payload(this.accessToken, data);
    }
}
@@ -173,620 +173,1840 @@
 e;%0A%0A
-public final class Payload %7B%0A    private final String accessToken;%0A    private final Data data;%0A%0A    public Payload(String accessToken, Data data) throws ArgumentNullException %7B%0A        Validate.isNotNullOrWhitespace(accessToken, %22accessToken%22);%0A        this.accessToken = accessToken;%0A%0A        Validate.isNotNull(data, %22data%22);%0A        this.data = data;%0A    %7D%0A%0A    public String accessToken() %7B%0A        return accessToken;%0A    %7D%0A%0A    public Data data() %7B%0A        return data;%0A    %7D%0A%0A    public Payload accessToken(String token) throws ArgumentNullException %7B%0A        return new Payload(token, this.data);%0A    %7D%0A
+/**%0A * Represents the payload to send to Rollbar. A successfully constructed Payload matches Rollbar's spec, and should be%0A * successful when serialized and POSTed to the correct endpoint.%0A */%0Apublic final class Payload %7B%0A    private final String accessToken;%0A    private final Data data;%0A%0A    /**%0A     * Constructor%0A     * @param accessToken An access token with scope %22post_server_item%22 or %22post_client_item%22. Probably %22server%22 unless%0A     *                    your %7B@link Data#platform()%7D is %22android%22 or %22client%22. Must not be null or whitespace.%0A     * @param data The data to POST to Rollbar. Must not be null.%0A     * @throws ArgumentNullException if either argument was null%0A     */%0A    public Payload(String accessToken, Data data) throws ArgumentNullException %7B%0A        Validate.isNotNullOrWhitespace(accessToken, %22accessToken%22);%0A        this.accessToken = accessToken;%0A%0A        Validate.isNotNull(data, %22data%22);%0A        this.data = data;%0A    %7D%0A%0A    /**%0A     * Get the access token%0A     * @return the access token%0A     */%0A    public String accessToken() %7B%0A        return accessToken;%0A    %7D%0A%0A    /**%0A     * Get the Data%0A     * @return the data%0A     */%0A    public Data data() %7B%0A        return data;%0A    %7D%0A%0A    /**%0A     * Set the access token on a clone of this object%0A     * @param token the token to override this one with%0A     * @return a copy of this Payload with the token overridden%0A     * @throws ArgumentNullException if %7B@code token%7D is null%0A     */%0A    public Payload accessToken(String token) throws ArgumentNullException %7B%0A        return new Payload(token, this.data);%0A    %7D%0A%0A    /**%0A     * Set the data on a clone of this object%0A     * @param data the data to override this one with%0A     * @return a copy of this Payload with the token overriden%0A     * @throws ArgumentNullException if %7B@code data%7D is null%0A     */
 %0A   

Document Payload