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

com.nutanix.dp1.dat.dataprotection.v4.config.RecoveryPointRepository Maven / Gradle / Ivy

Go to download

Business Continuity with full spectrum of Disaster Recovery and Backup solution. Spanning across Single PC, Cross AZ, MultiSite. Configuration of Recovery points, Protection policies, Recovery Plans. Execution and monitoring of back up and recovery orchestrations on OnPrem as well as Cloud.

The newest version!
/*
 * Generated file ..
 *
 * Product version: 4.0.1-beta-1
 *
 * Part of the Nutanix Dataprotection Versioned APIs
 *
 * (c) 2024 Nutanix Inc.  All rights reserved
 *
 */

package com.nutanix.dp1.dat.dataprotection.v4.config;

import com.fasterxml.jackson.annotation.JsonAnySetter;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.AccessLevel;
import com.nutanix.devplatform.models.PrettyModeViews.*;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.stream.Collectors;
import com.nutanix.dp1.dat.deserializers.DatObjectTypeTypedObject;

import javax.validation.constraints.*;

import java.util.List;

import static com.nutanix.dp1.dat.deserializers.DatDeserializerUtils.*;


/**
 * A recovery point repository is a reference to a data store which can be used to store recovery points using Multicloud snapshot technology (MST). It can be backed by any S3-compatible object storage solutions, which include options like Nutanix Objects, as well as hyperscaler offerings such as Amazon AWS S3 and Microsoft Azure Blobs.
 */


@EqualsAndHashCode(callSuper=true)
@Data
@lombok.extern.slf4j.Slf4j
public class RecoveryPointRepository extends com.nutanix.dp1.dat.common.v1.response.ExternalizableAbstractModel implements java.io.Serializable, DatObjectTypeTypedObject {

  

  public RecoveryPointRepository() {
    super();
    
  }

  @lombok.Builder(builderMethodName = "RecoveryPointRepositoryBuilder")
  public RecoveryPointRepository(String tenantId, String extId, java.util.List links, String name, com.nutanix.dp1.dat.dataprotection.v4.config.ObjectStorageType objectStorageType, Object objectStorageReference) {
    super(tenantId, extId, links);

    this.setName(name);

    this.setObjectStorageType(objectStorageType);
    this.setObjectStorageReferenceInWrapper(objectStorageReference);
      }

  @Override 
  protected String initialize$objectType() {
    return "dataprotection.v4.config.RecoveryPointRepository";
  }

  @Override 
  protected String initialize$fv() {
    return "v4.r0.b1";
  }


  
  

  
    /**
    * Name of the recovery point repository.
    */
    @javax.validation.constraints.Size(max = 256)
    
    @JsonProperty("name")
    public String name = null;
  
  

  
    /**
    * 
    */
    
    @JsonProperty("objectStorageType")
    public com.nutanix.dp1.dat.dataprotection.v4.config.ObjectStorageType objectStorageType = null;
  
  
    
    
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    @Getter
    private String $objectStorageReferenceItemDiscriminator = null;
    
    @Data
    @com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = OneOfObjectStorageReferenceWrapper.OneOfObjectStorageReferenceWrapperJsonDeserializer.class)
    public static class OneOfObjectStorageReferenceWrapper {
    
    
      public OneOfObjectStorageReferenceWrapper() {
      }
    
    
    
      public OneOfObjectStorageReferenceWrapper(com.nutanix.dp1.dat.dataprotection.v4.config.AzureBlobStorageContainer data) {
        this.oneOfType0 = data;

        this.discriminator = data.get$objectType();
        this.$objectType = data.get$objectType();
      }
      public OneOfObjectStorageReferenceWrapper(com.nutanix.dp1.dat.dataprotection.v4.config.AmazonS3Bucket data) {
        this.oneOfType1 = data;

        this.discriminator = data.get$objectType();
        this.$objectType = data.get$objectType();
      }
      public OneOfObjectStorageReferenceWrapper(com.nutanix.dp1.dat.dataprotection.v4.config.NutanixObjectsBucket data) {
        this.oneOfType2 = data;

        this.discriminator = data.get$objectType();
        this.$objectType = data.get$objectType();
      }
    
      @com.nutanix.dp1.dat.annotations.DatJsonDeserializer
      private static class OneOfObjectStorageReferenceWrapperJsonDeserializer extends com.nutanix.dp1.dat.deserializers.DatOneOfDeserializer  {
        private static final com.fasterxml.jackson.databind.type.TypeFactory TYPE_FACTORY = com.fasterxml.jackson.databind.type.TypeFactory.defaultInstance();
        private static final com.fasterxml.jackson.databind.JavaType ONE_OF_TYPE0 = TYPE_FACTORY.constructType(com.nutanix.dp1.dat.dataprotection.v4.config.AzureBlobStorageContainer.class);
        private static final com.fasterxml.jackson.databind.JavaType ONE_OF_TYPE1 = TYPE_FACTORY.constructType(com.nutanix.dp1.dat.dataprotection.v4.config.AmazonS3Bucket.class);
        private static final com.fasterxml.jackson.databind.JavaType ONE_OF_TYPE2 = TYPE_FACTORY.constructType(com.nutanix.dp1.dat.dataprotection.v4.config.NutanixObjectsBucket.class);
    
        public OneOfObjectStorageReferenceWrapperJsonDeserializer() {
          super(TYPE_FACTORY.constructType(OneOfObjectStorageReferenceWrapper.class));
        }
    
        @Override
        protected void setDataObject(OneOfObjectStorageReferenceWrapper oneOfObject, Object nestedObject) {
          if (oneOfObject == null) {
            throw new IllegalArgumentException("Instance of OneOfObjectStorageReferenceWrapper provided is null");
          }
          if(ONE_OF_TYPE0.getRawClass().isAssignableFrom(nestedObject.getClass())) {
            oneOfObject.setValue(nestedObject);
            if (oneOfObject.getValue() != null) {
                return;
            }
          }
          if(ONE_OF_TYPE1.getRawClass().isAssignableFrom(nestedObject.getClass())) {
            oneOfObject.setValue(nestedObject);
            if (oneOfObject.getValue() != null) {
                return;
            }
          }
          if(ONE_OF_TYPE2.getRawClass().isAssignableFrom(nestedObject.getClass())) {
            oneOfObject.setValue(nestedObject);
            if (oneOfObject.getValue() != null) {
                return;
            }
          }
    
          throw new IllegalArgumentException("Attempting to set unsupported object type in OneOfObjectStorageReferenceWrapper:" + nestedObject.getClass().getName());
        }
    
        public String getPackagePrefix() {
          return "com.nutanix.dp1.dat";
        }
      }
    
      @com.fasterxml.jackson.annotation.JsonIgnore
      @lombok.Getter(lombok.AccessLevel.NONE)
      @lombok.Setter(lombok.AccessLevel.NONE)

      private com.nutanix.dp1.dat.dataprotection.v4.config.AzureBlobStorageContainer oneOfType0;
      @com.fasterxml.jackson.annotation.JsonIgnore
      @lombok.Getter(lombok.AccessLevel.NONE)
      @lombok.Setter(lombok.AccessLevel.NONE)

      private com.nutanix.dp1.dat.dataprotection.v4.config.AmazonS3Bucket oneOfType1;
      @com.fasterxml.jackson.annotation.JsonIgnore
      @lombok.Getter(lombok.AccessLevel.NONE)
      @lombok.Setter(lombok.AccessLevel.NONE)

      private com.nutanix.dp1.dat.dataprotection.v4.config.NutanixObjectsBucket oneOfType2;
    
      @lombok.Setter(lombok.AccessLevel.NONE)
      private String discriminator;
    
    
      @com.fasterxml.jackson.annotation.JsonIgnore
      @lombok.Setter(lombok.AccessLevel.NONE)
      private String $objectType;
    
      @com.fasterxml.jackson.annotation.JsonGetter
      public Object getValue() {

        if(oneOfType0 != null && oneOfType0.get$objectType().equals(this.discriminator)) {
          return this.oneOfType0;
        }

        if(oneOfType1 != null && oneOfType1.get$objectType().equals(this.discriminator)) {
          return this.oneOfType1;
        }

        if(oneOfType2 != null && oneOfType2.get$objectType().equals(this.discriminator)) {
          return this.oneOfType2;
        }
        throw new IllegalArgumentException("Unrecognized discriminator:" + this.discriminator);
      }
    
      public void setValue(Object value) {
        if(value == null) {

          log.warn("null passed to setValue function. OneOf's value will not be set.");
          return;
        }
    

        if (value instanceof com.nutanix.dp1.dat.dataprotection.v4.config.AzureBlobStorageContainer) {
          this.oneOfType0 = (com.nutanix.dp1.dat.dataprotection.v4.config.AzureBlobStorageContainer) value;

          this.discriminator = this.oneOfType0.get$objectType();
          this.$objectType = this.oneOfType0.get$objectType();
          return;
        }

        if (value instanceof com.nutanix.dp1.dat.dataprotection.v4.config.AmazonS3Bucket) {
          this.oneOfType1 = (com.nutanix.dp1.dat.dataprotection.v4.config.AmazonS3Bucket) value;

          this.discriminator = this.oneOfType1.get$objectType();
          this.$objectType = this.oneOfType1.get$objectType();
          return;
        }

        if (value instanceof com.nutanix.dp1.dat.dataprotection.v4.config.NutanixObjectsBucket) {
          this.oneOfType2 = (com.nutanix.dp1.dat.dataprotection.v4.config.NutanixObjectsBucket) value;

          this.discriminator = this.oneOfType2.get$objectType();
          this.$objectType = this.oneOfType2.get$objectType();
          return;
        }
    
        throw new IllegalArgumentException("Attempting to set unsupported object type in OneOfObjectStorageReferenceWrapper:" + value.getClass().getName());
    
      }
    
    }
  
    private OneOfObjectStorageReferenceWrapper objectStorageReference = null;
  
    /**
     * @deprecated
     * @param value one of wrapper instance
     */
    public void setObjectStorageReference(OneOfObjectStorageReferenceWrapper value) {
      log.warn("Deprecating this method, please use setDataInWrapper instead");
      if (value == null) {
        return;
      }
      this.objectStorageReference = value;
      this.$objectStorageReferenceItemDiscriminator = this.objectStorageReference.getDiscriminator();
    }
  
    /**
     * @param value value of one of field objectStorageReference
     */
    @com.fasterxml.jackson.annotation.JsonIgnore
    public void setObjectStorageReferenceInWrapper(Object value) {
      if (value == null) {
        return;
      }
      if (this.objectStorageReference == null) {
        this.objectStorageReference = new OneOfObjectStorageReferenceWrapper();
      }
      this.objectStorageReference.setValue(value);
      this.$objectStorageReferenceItemDiscriminator = this.objectStorageReference.getDiscriminator();
    }
  
    /**
     * Get objectStorageReference in one of possible types :
     * 
    *
  • com.nutanix.dp1.dat.dataprotection.v4.config.AzureBlobStorageContainer
  • *
  • com.nutanix.dp1.dat.dataprotection.v4.config.AmazonS3Bucket
  • *
  • com.nutanix.dp1.dat.dataprotection.v4.config.NutanixObjectsBucket
  • *
* @return Object */ @com.fasterxml.jackson.databind.annotation.JsonSerialize(using = com.nutanix.dp1.dat.serializers.DatOneOfSerializer.class) public Object getObjectStorageReference() { if (this.objectStorageReference == null) { log.debug("OneOf property objectStorageReference was never set. Returning null..."); return null; } return this.objectStorageReference.getValue(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy