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

com.solidfire.element.api.ListVolumesRequest Maven / Gradle / Ivy

Go to download

Library for interfacing with the Public and Incubating SolidFire Element API.

There is a newer version: 1.0.0.53
Show newest version



/*
 * Copyright © 2015 SolidFire, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * DO NOT EDIT THIS CODE BY HAND! It has been generated with jsvcgen.
 */
package com.solidfire.element.api;

import com.solidfire.javautil.Optional;

import com.solidfire.client.ApiException;
import com.solidfire.javautil.Optional;

import java.net.URL;
import java.util.Arrays;
import java.util.Objects;
import com.solidfire.annotation.Since;

import static com.solidfire.javautil.Optional.of;


/**
 * The Request object for the "ListVolumes" API Service call.
 **/
public class ListVolumesRequest {

    private final Optional startVolumeID;
    private final Optional limit;
    private final Optional volumeStatus;
    private final Optional accounts;
    private final Optional isPaired;

    /**
     * The Request object for the "ListVolumes" API Service call.
     * @param startVolumeID (optional) The ID of the first volume to list.
     * @param limit (optional) The maximum number of volumes to return from the API.
     * @param volumeStatus (optional) If specified, filter to only volumes with the provided status.
     * @param accounts (optional) If specified, only fetch volumes which belong to the provided accounts.
     * @param isPaired (optional) If specified, only fetch volumes which are paired (if true) or non-paired (if false).
     * @since 7.0
     **/
    @Since("7.0")
    public ListVolumesRequest(Optional startVolumeID, Optional limit, Optional volumeStatus, Optional accounts, Optional isPaired) {
        this.volumeStatus = volumeStatus;
        this.isPaired = isPaired;
        this.limit = limit;
        this.startVolumeID = startVolumeID;
        this.accounts = accounts;
    }


    /**
     * The ID of the first volume to list.
     * This can be useful for paging results.
     * By default, this starts at the lowest VolumeID.
     **/
    public Optional getStartVolumeID() {
        return this.startVolumeID;
    }

    /**
     * The maximum number of volumes to return from the API.
     **/
    public Optional getLimit() {
        return this.limit;
    }

    /**
     * If specified, filter to only volumes with the provided status.
     * By default, list all volumes.
     **/
    public Optional getVolumeStatus() {
        return this.volumeStatus;
    }

    /**
     * If specified, only fetch volumes which belong to the provided accounts.
     * By default, list volumes for all accounts.
     **/
    public Optional getAccounts() {
        return this.accounts;
    }

    /**
     * If specified, only fetch volumes which are paired (if true) or non-paired (if false).
     * By default, list all volumes regardless of their pairing status.
     **/
    public Optional getIsPaired() {
        return this.isPaired;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ListVolumesRequest that = (ListVolumesRequest) o;
        

        return Objects.equals( startVolumeID , that.startVolumeID )
            && Objects.equals( limit , that.limit )
            && Objects.equals( volumeStatus , that.volumeStatus )
            && Objects.deepEquals( accounts , that.accounts )
            && Objects.equals( isPaired , that.isPaired );
    }

    @Override
    public int hashCode() {

        return Objects.hash( startVolumeID, limit, volumeStatus, accounts, isPaired );
    }


    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append( "{ " );

        if(null != startVolumeID && startVolumeID.isPresent())
            sb.append(" startVolumeID : ").append(startVolumeID.get()).append(",");
        if(null != limit && limit.isPresent())
            sb.append(" limit : ").append(limit.get()).append(",");
        if(null != volumeStatus && volumeStatus.isPresent())
            sb.append(" volumeStatus : ").append(volumeStatus.get()).append(",");
        if(null != accounts && accounts.isPresent())
            sb.append(" accounts : ").append(Arrays.toString(accounts.get())).append(",");
        if(null != isPaired && isPaired.isPresent())
            sb.append(" isPaired : ").append(isPaired.get());
        sb.append( " }" );

        if(sb.lastIndexOf(", }") != -1)
            sb.deleteCharAt(sb.lastIndexOf(", }"));

        return sb.toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy