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

com.blazebit.expression.azure.subscription.model.Subscription Maven / Gradle / Ivy

/*
 * SubscriptionClient
 * All resource groups and resources exist within subscriptions. These operation enable you get information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure AD) for your organization.
 *
 * The version of the OpenAPI document: 2022-12-01
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.blazebit.expression.azure.subscription.model;

import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.blazebit.expression.azure.subscription.model.ManagedByTenant;
import com.blazebit.expression.azure.subscription.model.SubscriptionPolicies;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.blazebit.expression.azure.invoker.JSON;


/**
 * Subscription information.
 */
@JsonPropertyOrder({
  Subscription.JSON_PROPERTY_ID,
  Subscription.JSON_PROPERTY_SUBSCRIPTION_ID,
  Subscription.JSON_PROPERTY_DISPLAY_NAME,
  Subscription.JSON_PROPERTY_TENANT_ID,
  Subscription.JSON_PROPERTY_STATE,
  Subscription.JSON_PROPERTY_SUBSCRIPTION_POLICIES,
  Subscription.JSON_PROPERTY_AUTHORIZATION_SOURCE,
  Subscription.JSON_PROPERTY_MANAGED_BY_TENANTS,
  Subscription.JSON_PROPERTY_TAGS
})
@com.blazebit.domain.declarative.DomainType
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-27T17:30:38.203241700+01:00[Europe/Berlin]", comments = "Generator version: 7.5.0")
public class Subscription {
  public static final String JSON_PROPERTY_ID = "id";
  private String id;

  public static final String JSON_PROPERTY_SUBSCRIPTION_ID = "subscriptionId";
  private String subscriptionId;

  public static final String JSON_PROPERTY_DISPLAY_NAME = "displayName";
  private String displayName;

  public static final String JSON_PROPERTY_TENANT_ID = "tenantId";
  private String tenantId;

  /**
   * The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.
   */
  @com.blazebit.domain.declarative.DomainType
public enum StateEnum {
    ENABLED("Enabled"),
    
    WARNED("Warned"),
    
    PASTDUE("PastDue"),
    
    DISABLED("Disabled"),
    
    DELETED("Deleted");

    private String value;

    StateEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static StateEnum fromValue(String value) {
      for (StateEnum b : StateEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_STATE = "state";
  private StateEnum state;

  public static final String JSON_PROPERTY_SUBSCRIPTION_POLICIES = "subscriptionPolicies";
  private SubscriptionPolicies subscriptionPolicies;

  public static final String JSON_PROPERTY_AUTHORIZATION_SOURCE = "authorizationSource";
  private String authorizationSource;

  public static final String JSON_PROPERTY_MANAGED_BY_TENANTS = "managedByTenants";
  private List managedByTenants = new ArrayList<>();

  public static final String JSON_PROPERTY_TAGS = "tags";
  private Map tags = new HashMap<>();

  public Subscription() { 
  }

  @JsonCreator
  public Subscription(
    @JsonProperty(JSON_PROPERTY_ID) String id, 
    @JsonProperty(JSON_PROPERTY_SUBSCRIPTION_ID) String subscriptionId, 
    @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) String displayName, 
    @JsonProperty(JSON_PROPERTY_TENANT_ID) String tenantId, 
    @JsonProperty(JSON_PROPERTY_STATE) StateEnum state
  ) {
    this();
    this.id = id;
    this.subscriptionId = subscriptionId;
    this.displayName = displayName;
    this.tenantId = tenantId;
    this.state = state;
  }

   /**
   * The fully qualified ID for the subscription. For example, /subscriptions/8d65815f-a5b6-402f-9298-045155da7d74
   * @return id
  **/
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getId() {
    return id;
  }




   /**
   * The subscription ID.
   * @return subscriptionId
  **/
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SUBSCRIPTION_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getSubscriptionId() {
    return subscriptionId;
  }




   /**
   * The subscription display name.
   * @return displayName
  **/
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_DISPLAY_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getDisplayName() {
    return displayName;
  }




   /**
   * The subscription tenant ID.
   * @return tenantId
  **/
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_TENANT_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getTenantId() {
    return tenantId;
  }




   /**
   * The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.
   * @return state
  **/
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_STATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public StateEnum getState() {
    return state;
  }




  public Subscription subscriptionPolicies(SubscriptionPolicies subscriptionPolicies) {
    this.subscriptionPolicies = subscriptionPolicies;
    return this;
  }

   /**
   * Get subscriptionPolicies
   * @return subscriptionPolicies
  **/
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SUBSCRIPTION_POLICIES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public SubscriptionPolicies getSubscriptionPolicies() {
    return subscriptionPolicies;
  }


  @JsonProperty(JSON_PROPERTY_SUBSCRIPTION_POLICIES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSubscriptionPolicies(SubscriptionPolicies subscriptionPolicies) {
    this.subscriptionPolicies = subscriptionPolicies;
  }


  public Subscription authorizationSource(String authorizationSource) {
    this.authorizationSource = authorizationSource;
    return this;
  }

   /**
   * The authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'.
   * @return authorizationSource
  **/
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_AUTHORIZATION_SOURCE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getAuthorizationSource() {
    return authorizationSource;
  }


  @JsonProperty(JSON_PROPERTY_AUTHORIZATION_SOURCE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAuthorizationSource(String authorizationSource) {
    this.authorizationSource = authorizationSource;
  }


  public Subscription managedByTenants(List managedByTenants) {
    this.managedByTenants = managedByTenants;
    return this;
  }

  public Subscription addManagedByTenantsItem(ManagedByTenant managedByTenantsItem) {
    if (this.managedByTenants == null) {
      this.managedByTenants = new ArrayList<>();
    }
    this.managedByTenants.add(managedByTenantsItem);
    return this;
  }

   /**
   * An array containing the tenants managing the subscription.
   * @return managedByTenants
  **/
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MANAGED_BY_TENANTS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List getManagedByTenants() {
    return managedByTenants;
  }


  @JsonProperty(JSON_PROPERTY_MANAGED_BY_TENANTS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setManagedByTenants(List managedByTenants) {
    this.managedByTenants = managedByTenants;
  }


  public Subscription tags(Map tags) {
    this.tags = tags;
    return this;
  }

  public Subscription putTagsItem(String key, String tagsItem) {
    if (this.tags == null) {
      this.tags = new HashMap<>();
    }
    this.tags.put(key, tagsItem);
    return this;
  }

   /**
   * The tags attached to the subscription.
   * @return tags
  **/
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_TAGS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Map getTags() {
    return tags;
  }


  @JsonProperty(JSON_PROPERTY_TAGS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setTags(Map tags) {
    this.tags = tags;
  }


  /**
   * Return true if this Subscription object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Subscription subscription = (Subscription) o;
    return Objects.equals(this.id, subscription.id) &&
        Objects.equals(this.subscriptionId, subscription.subscriptionId) &&
        Objects.equals(this.displayName, subscription.displayName) &&
        Objects.equals(this.tenantId, subscription.tenantId) &&
        Objects.equals(this.state, subscription.state) &&
        Objects.equals(this.subscriptionPolicies, subscription.subscriptionPolicies) &&
        Objects.equals(this.authorizationSource, subscription.authorizationSource) &&
        Objects.equals(this.managedByTenants, subscription.managedByTenants) &&
        Objects.equals(this.tags, subscription.tags);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, subscriptionId, displayName, tenantId, state, subscriptionPolicies, authorizationSource, managedByTenants, tags);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Subscription {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n");
    sb.append("    displayName: ").append(toIndentedString(displayName)).append("\n");
    sb.append("    tenantId: ").append(toIndentedString(tenantId)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    subscriptionPolicies: ").append(toIndentedString(subscriptionPolicies)).append("\n");
    sb.append("    authorizationSource: ").append(toIndentedString(authorizationSource)).append("\n");
    sb.append("    managedByTenants: ").append(toIndentedString(managedByTenants)).append("\n");
    sb.append("    tags: ").append(toIndentedString(tags)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy