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

com.nutanix.dp1.mic.common.v1.config.TenantAwareModel Maven / Gradle / Ivy

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

package com.nutanix.dp1.mic.common.v1.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.mic.deserializers.MicObjectTypeTypedObject;

import javax.validation.constraints.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.nutanix.dp1.mic.deserializers.MicDeserializerUtils.*;


/**
 * A model base class whose instances are bound to a specific tenant.  This model adds a tenantId to the base model class that it extends and is automatically set by the server.
 * 
 */



@Data
@lombok.extern.slf4j.Slf4j
public class TenantAwareModel implements java.io.Serializable, MicObjectTypeTypedObject {

  

  public TenantAwareModel() {

    this.$objectType = this.initialize$objectType();
    this.$reserved = new java.util.LinkedHashMap<>();
    this.$reserved.put("$fv", this.initialize$fv());
    this.$unknownFields = new java.util.LinkedHashMap<>();

  }

  @lombok.Builder(builderMethodName = "TenantAwareModelBuilder")
  public TenantAwareModel(String tenantId) {
    this.$objectType = this.initialize$objectType();
    this.$reserved = new java.util.LinkedHashMap<>();
    this.$reserved.put("$fv", this.initialize$fv());
    this.$unknownFields = new java.util.LinkedHashMap<>();

    this.setTenantId(tenantId);
  }


  protected String initialize$objectType() {
    return "common.v1.config.TenantAwareModel";
  }


  protected String initialize$fv() {
    return "v1.r0.b1";
  }

  @JsonAnySetter
  private void setUndeserializedFields(String name, String value) {
    $unknownFields.put(name, value);
  }


  

    @javax.validation.constraints.Pattern(regexp="^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")
    
    
    
    private String tenantId = null;
  
    /**
     * A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).

     */
    public void setTenantId(String tenantId) {
      if (this.tenantId == null) {
        this.tenantId = tenantId;
      }
      else {
        log.warn("Read-only property tenantId already contains a non-null value and cannot be set again");
      }
    }
  
  

  
    
    
    @Getter
    @JsonView({StandardView.class})
    
    protected final Map $reserved;
  
  

  
    
    
    @Getter
    @JsonView({StandardView.class})
    
    protected final String $objectType;
  
  

  
    
    
    @Getter
    @JsonView({StandardView.class})
    
    protected final Map $unknownFields;
  
  

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy