/* DO NOT EDIT */
/* This file was generated by Stone */

package com.dropbox.core.v2.team;

import com.dropbox.core.DbxException;

/**
 * The request builder returned by {@link
 * DbxTeamTeamRequests#devicesListTeamDevicesBuilder}.
 *
 * <p> Use this class to set optional request parameters and complete the
 * request. </p>
 */
public class DevicesListTeamDevicesBuilder {
    private final DbxTeamTeamRequests _client;
    private final ListTeamDevicesArg.Builder _builder;

    /**
     * Creates a new instance of this builder.
     *
     * @param _client  Dropbox namespace-specific client used to issue team
     *     requests.
     * @param _builder  Request argument builder.
     *
     * @return instsance of this builder
     */
    DevicesListTeamDevicesBuilder(DbxTeamTeamRequests _client, ListTeamDevicesArg.Builder _builder) {
        if (_client == null) {
            throw new NullPointerException("_client");
        }
        this._client = _client;
        if (_builder == null) {
            throw new NullPointerException("_builder");
        }
        this._builder = _builder;
    }

    /**
     * Set value for optional field.
     *
     * @param cursor  At the first call to the {@link
     *     DbxTeamTeamRequests#devicesListTeamDevices} the cursor shouldn't be
     *     passed. Then, if the result of the call includes a cursor, the
     *     following requests should include the received cursors in order to
     *     receive the next sub list of team devices.
     *
     * @return this builder
     */
    public DevicesListTeamDevicesBuilder withCursor(String cursor) {
        this._builder.withCursor(cursor);
        return this;
    }

    /**
     * Set value for optional field.
     *
     * <p> If left unset or set to {@code null}, defaults to {@code true}. </p>
     *
     * @param includeWebSessions  Whether to list web sessions of the team
     *     members. Defaults to {@code true} when set to {@code null}.
     *
     * @return this builder
     */
    public DevicesListTeamDevicesBuilder withIncludeWebSessions(Boolean includeWebSessions) {
        this._builder.withIncludeWebSessions(includeWebSessions);
        return this;
    }

    /**
     * Set value for optional field.
     *
     * <p> If left unset or set to {@code null}, defaults to {@code true}. </p>
     *
     * @param includeDesktopClients  Whether to list desktop clients of the team
     *     members. Defaults to {@code true} when set to {@code null}.
     *
     * @return this builder
     */
    public DevicesListTeamDevicesBuilder withIncludeDesktopClients(Boolean includeDesktopClients) {
        this._builder.withIncludeDesktopClients(includeDesktopClients);
        return this;
    }

    /**
     * Set value for optional field.
     *
     * <p> If left unset or set to {@code null}, defaults to {@code true}. </p>
     *
     * @param includeMobileClients  Whether to list mobile clients of the team
     *     members. Defaults to {@code true} when set to {@code null}.
     *
     * @return this builder
     */
    public DevicesListTeamDevicesBuilder withIncludeMobileClients(Boolean includeMobileClients) {
        this._builder.withIncludeMobileClients(includeMobileClients);
        return this;
    }

    /**
     * Issues the request.
     */
    @SuppressWarnings("deprecation")
    public ListTeamDevicesResult start() throws ListTeamDevicesErrorException, DbxException {
        ListTeamDevicesArg arg_ = this._builder.build();
        return _client.devicesListTeamDevices(arg_);
    }
}
