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

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

The newest version!
/*
 * Copyright © 2014-2016 NetApp, 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.gson.Gson;
import com.solidfire.core.client.Attributes;
import com.solidfire.gson.annotations.SerializedName;
import com.solidfire.core.annotation.Since;
import com.solidfire.core.javautil.Optional;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Objects;

/**
 * DeleteVolumesRequest  
 * DeleteVolumes marks multiple (up to 500) active volumes for deletion.
 * Once marked, the volumes are purged (permanently deleted) after the cleanup interval elapses.
 * The cleanup interval can be set in the SetClusterSettings method.
 * For more information on using this method, see SetClusterSettings on page 1.
 * After making a request to delete volumes, any active iSCSI connections to the volumes are immediately terminated
 * and no further connections are allowed while the volumes are in this state.
 * A marked volume is not returned in target discovery requests.
 * Any snapshots of a volume that has been marked for deletion are not affected.
 * Snapshots are kept until the volume is purged from the system.
 * If a volume is marked for deletion and has a bulk volume read or bulk volume write operation in progress,
 * the bulk volume read or write operation is stopped.
 * If the volumes you delete are paired with a volume, replication between the paired volumes is suspended
 * and no data is transferred to them or from them while in a deleted state.
 * The remote volumes the deleted volumes were paired with enter into a PausedMisconfigured state
 * and data is no longer sent to them or from the deleted volumes.
 * Until the deleted volumes are purged, they can be restored and data transfers resume.
 * If the deleted volumes are purged from the system, the volumes they were paired with enter into a
 * StoppedMisconfigured state and the volume pairing status is removed.
 * The purged volumes become permanently unavailable.
 **/

public class DeleteVolumesRequest implements Serializable {

    public static final long serialVersionUID = 8467114120532745883L;
    @SerializedName("accountIDs") private Optional accountIDs;
    @SerializedName("volumeAccessGroupIDs") private Optional volumeAccessGroupIDs;
    @SerializedName("volumeIDs") private Optional volumeIDs;
    // empty constructor
    @Since("7.0")
    public DeleteVolumesRequest() {}

    
    // parameterized constructor
    @Since("7.0")
    public DeleteVolumesRequest(
        Optional accountIDs,
        Optional volumeAccessGroupIDs,
        Optional volumeIDs
    )
    {
        this.accountIDs = (accountIDs == null) ? Optional.empty() : accountIDs;
        this.volumeAccessGroupIDs = (volumeAccessGroupIDs == null) ? Optional.empty() : volumeAccessGroupIDs;
        this.volumeIDs = (volumeIDs == null) ? Optional.empty() : volumeIDs;
    }

    /** 
     * A list of account IDs. All volumes from these accounts are deleted from the system. 
     **/
    public Optional getAccountIDs() { return this.accountIDs; }
   
    public void setAccountIDs(Optional accountIDs) { 
        this.accountIDs = (accountIDs == null) ? Optional.empty() : accountIDs;
    }
    /** 
     * A list of volume access group IDs. All of the volumes from all of the volume access groups you specify in this list are deleted from the system.
     **/
    public Optional getVolumeAccessGroupIDs() { return this.volumeAccessGroupIDs; }
   
    public void setVolumeAccessGroupIDs(Optional volumeAccessGroupIDs) { 
        this.volumeAccessGroupIDs = (volumeAccessGroupIDs == null) ? Optional.empty() : volumeAccessGroupIDs;
    }
    /** 
     * The list of IDs of the volumes to delete from the system.
     **/
    public Optional getVolumeIDs() { return this.volumeIDs; }
   
    public void setVolumeIDs(Optional volumeIDs) { 
        this.volumeIDs = (volumeIDs == null) ? Optional.empty() : volumeIDs;
    }

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

        DeleteVolumesRequest that = (DeleteVolumesRequest) o;

        return 
            Objects.equals(accountIDs, that.accountIDs) && 
            Objects.equals(volumeAccessGroupIDs, that.volumeAccessGroupIDs) && 
            Objects.equals(volumeIDs, that.volumeIDs);
    }

    @Override
    public int hashCode() {
        return Objects.hash( accountIDs,volumeAccessGroupIDs,volumeIDs );
    }


    public java.util.Map toMap() {
        java.util.Map map = new HashMap<>();
        map.put("accountIDs", accountIDs);
        map.put("volumeAccessGroupIDs", volumeAccessGroupIDs);
        map.put("volumeIDs", volumeIDs);
        return map;
    }

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

        if(null != accountIDs && accountIDs.isPresent()){
            sb.append(" accountIDs : ").append(gson.toJson(accountIDs)).append(",");
        }
        else{
            sb.append(" accountIDs : ").append("null").append(",");
        }
        if(null != volumeAccessGroupIDs && volumeAccessGroupIDs.isPresent()){
            sb.append(" volumeAccessGroupIDs : ").append(gson.toJson(volumeAccessGroupIDs)).append(",");
        }
        else{
            sb.append(" volumeAccessGroupIDs : ").append("null").append(",");
        }
        if(null != volumeIDs && volumeIDs.isPresent()){
            sb.append(" volumeIDs : ").append(gson.toJson(volumeIDs)).append(",");
        }
        else{
            sb.append(" volumeIDs : ").append("null").append(",");
        }
        sb.append( " }" );

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

        return sb.toString();
    }

    public static Builder builder() {
        return new Builder();
    }

    public final Builder asBuilder() {
        return new Builder().buildFrom(this);
    }

    public static class Builder {
        private Optional accountIDs;
        private Optional volumeAccessGroupIDs;
        private Optional volumeIDs;

        private Builder() { }

        public DeleteVolumesRequest build() {
            return new DeleteVolumesRequest (
                         this.accountIDs,
                         this.volumeAccessGroupIDs,
                         this.volumeIDs);
        }

        private DeleteVolumesRequest.Builder buildFrom(final DeleteVolumesRequest req) {
            this.accountIDs = req.accountIDs;
            this.volumeAccessGroupIDs = req.volumeAccessGroupIDs;
            this.volumeIDs = req.volumeIDs;

            return this;
        }

        public DeleteVolumesRequest.Builder optionalAccountIDs(final Long[] accountIDs) {
            this.accountIDs = (accountIDs == null) ? Optional.empty() : Optional.of(accountIDs);
            return this;
        }

        public DeleteVolumesRequest.Builder optionalVolumeAccessGroupIDs(final Long[] volumeAccessGroupIDs) {
            this.volumeAccessGroupIDs = (volumeAccessGroupIDs == null) ? Optional.empty() : Optional.of(volumeAccessGroupIDs);
            return this;
        }

        public DeleteVolumesRequest.Builder optionalVolumeIDs(final Long[] volumeIDs) {
            this.volumeIDs = (volumeIDs == null) ? Optional.empty() : Optional.of(volumeIDs);
            return this;
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy