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

com.oracle.bmc.fusionapps.model.Subscription Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2016, 2024, Oracle and/or its affiliates.  All rights reserved.
 * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
 */
package com.oracle.bmc.fusionapps.model;

/**
 * Subscription information for compartmentId. Only root compartments are allowed. 
* Note: Objects should always be created or deserialized using the {@link Builder}. This model * distinguishes fields that are {@code null} because they are unset from fields that are explicitly * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a * set of all explicitly set fields called {@link Builder#__explicitlySet__}. The {@link * #hashCode()} and {@link #equals(Object)} methods are implemented to take the explicitly set * fields into account. The constructor, on the other hand, does not take the explicitly set fields * into account (since the constructor cannot distinguish explicit {@code null} from unset {@code * null}). */ @jakarta.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20211201") @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = Subscription.Builder.class) @com.fasterxml.jackson.annotation.JsonFilter( com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel.EXPLICITLY_SET_FILTER_NAME) public final class Subscription extends com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel { @Deprecated @java.beans.ConstructorProperties({ "id", "classicSubscriptionId", "serviceName", "lifecycleState", "lifecycleDetails", "skus" }) public Subscription( String id, String classicSubscriptionId, String serviceName, LifecycleState lifecycleState, LifecycleDetails lifecycleDetails, java.util.List skus) { super(); this.id = id; this.classicSubscriptionId = classicSubscriptionId; this.serviceName = serviceName; this.lifecycleState = lifecycleState; this.lifecycleDetails = lifecycleDetails; this.skus = skus; } @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") public static class Builder { /** OCID of the subscription details for particular root compartment or tenancy. */ @com.fasterxml.jackson.annotation.JsonProperty("id") private String id; /** * OCID of the subscription details for particular root compartment or tenancy. * * @param id the value to set * @return this builder */ public Builder id(String id) { this.id = id; this.__explicitlySet__.add("id"); return this; } /** Subscription id. */ @com.fasterxml.jackson.annotation.JsonProperty("classicSubscriptionId") private String classicSubscriptionId; /** * Subscription id. * * @param classicSubscriptionId the value to set * @return this builder */ public Builder classicSubscriptionId(String classicSubscriptionId) { this.classicSubscriptionId = classicSubscriptionId; this.__explicitlySet__.add("classicSubscriptionId"); return this; } /** The type of subscription, such as 'CLOUDCM'/'SAAS'/'CRM', etc. */ @com.fasterxml.jackson.annotation.JsonProperty("serviceName") private String serviceName; /** * The type of subscription, such as 'CLOUDCM'/'SAAS'/'CRM', etc. * * @param serviceName the value to set * @return this builder */ public Builder serviceName(String serviceName) { this.serviceName = serviceName; this.__explicitlySet__.add("serviceName"); return this; } /** Lifecycle state of the subscription. */ @com.fasterxml.jackson.annotation.JsonProperty("lifecycleState") private LifecycleState lifecycleState; /** * Lifecycle state of the subscription. * * @param lifecycleState the value to set * @return this builder */ public Builder lifecycleState(LifecycleState lifecycleState) { this.lifecycleState = lifecycleState; this.__explicitlySet__.add("lifecycleState"); return this; } /** Subscription resource intermediate states. */ @com.fasterxml.jackson.annotation.JsonProperty("lifecycleDetails") private LifecycleDetails lifecycleDetails; /** * Subscription resource intermediate states. * * @param lifecycleDetails the value to set * @return this builder */ public Builder lifecycleDetails(LifecycleDetails lifecycleDetails) { this.lifecycleDetails = lifecycleDetails; this.__explicitlySet__.add("lifecycleDetails"); return this; } /** Stock keeping unit. */ @com.fasterxml.jackson.annotation.JsonProperty("skus") private java.util.List skus; /** * Stock keeping unit. * * @param skus the value to set * @return this builder */ public Builder skus(java.util.List skus) { this.skus = skus; this.__explicitlySet__.add("skus"); return this; } @com.fasterxml.jackson.annotation.JsonIgnore private final java.util.Set __explicitlySet__ = new java.util.HashSet(); public Subscription build() { Subscription model = new Subscription( this.id, this.classicSubscriptionId, this.serviceName, this.lifecycleState, this.lifecycleDetails, this.skus); for (String explicitlySetProperty : this.__explicitlySet__) { model.markPropertyAsExplicitlySet(explicitlySetProperty); } return model; } @com.fasterxml.jackson.annotation.JsonIgnore public Builder copy(Subscription model) { if (model.wasPropertyExplicitlySet("id")) { this.id(model.getId()); } if (model.wasPropertyExplicitlySet("classicSubscriptionId")) { this.classicSubscriptionId(model.getClassicSubscriptionId()); } if (model.wasPropertyExplicitlySet("serviceName")) { this.serviceName(model.getServiceName()); } if (model.wasPropertyExplicitlySet("lifecycleState")) { this.lifecycleState(model.getLifecycleState()); } if (model.wasPropertyExplicitlySet("lifecycleDetails")) { this.lifecycleDetails(model.getLifecycleDetails()); } if (model.wasPropertyExplicitlySet("skus")) { this.skus(model.getSkus()); } return this; } } /** Create a new builder. */ public static Builder builder() { return new Builder(); } public Builder toBuilder() { return new Builder().copy(this); } /** OCID of the subscription details for particular root compartment or tenancy. */ @com.fasterxml.jackson.annotation.JsonProperty("id") private final String id; /** * OCID of the subscription details for particular root compartment or tenancy. * * @return the value */ public String getId() { return id; } /** Subscription id. */ @com.fasterxml.jackson.annotation.JsonProperty("classicSubscriptionId") private final String classicSubscriptionId; /** * Subscription id. * * @return the value */ public String getClassicSubscriptionId() { return classicSubscriptionId; } /** The type of subscription, such as 'CLOUDCM'/'SAAS'/'CRM', etc. */ @com.fasterxml.jackson.annotation.JsonProperty("serviceName") private final String serviceName; /** * The type of subscription, such as 'CLOUDCM'/'SAAS'/'CRM', etc. * * @return the value */ public String getServiceName() { return serviceName; } /** Lifecycle state of the subscription. */ public enum LifecycleState implements com.oracle.bmc.http.internal.BmcEnum { Creating("CREATING"), Active("ACTIVE"), Inactive("INACTIVE"), Updating("UPDATING"), Deleting("DELETING"), Deleted("DELETED"), Failed("FAILED"), NeedsAttention("NEEDS_ATTENTION"), /** * This value is used if a service returns a value for this enum that is not recognized by * this version of the SDK. */ UnknownEnumValue(null); private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(LifecycleState.class); private final String value; private static java.util.Map map; static { map = new java.util.HashMap<>(); for (LifecycleState v : LifecycleState.values()) { if (v != UnknownEnumValue) { map.put(v.getValue(), v); } } } LifecycleState(String value) { this.value = value; } @com.fasterxml.jackson.annotation.JsonValue public String getValue() { return value; } @com.fasterxml.jackson.annotation.JsonCreator public static LifecycleState create(String key) { if (map.containsKey(key)) { return map.get(key); } LOG.warn( "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", key); return UnknownEnumValue; } }; /** Lifecycle state of the subscription. */ @com.fasterxml.jackson.annotation.JsonProperty("lifecycleState") private final LifecycleState lifecycleState; /** * Lifecycle state of the subscription. * * @return the value */ public LifecycleState getLifecycleState() { return lifecycleState; } /** Subscription resource intermediate states. */ public enum LifecycleDetails implements com.oracle.bmc.http.internal.BmcEnum { Active("ACTIVE"), Purged("PURGED"), Canceled("CANCELED"), PaidPurged("PAID_PURGED"), Initialized("INITIALIZED"), SoftTerminated("SOFT_TERMINATED"), Disabled("DISABLED"), BeginTermination("BEGIN_TERMINATION"), Migrated("MIGRATED"), PendingCancelation("PENDING_CANCELATION"), Archived("ARCHIVED"), NonRecoverable("NON_RECOVERABLE"), BeginSoftTermination("BEGIN_SOFT_TERMINATION"), Activated("ACTIVATED"), AccessDisabled("ACCESS_DISABLED"), PendingRegistration("PENDING_REGISTRATION"), Terminated("TERMINATED"), Relocating("RELOCATING"), Deprovisioned("DEPROVISIONED"), Provisioned("PROVISIONED"), BeginTerminationPassive("BEGIN_TERMINATION_PASSIVE"), Locked("LOCKED"), PendingDeprovisioning("PENDING_DEPROVISIONING"), Registered("REGISTERED"), Cancelled("CANCELLED"), Expired("EXPIRED"), /** * This value is used if a service returns a value for this enum that is not recognized by * this version of the SDK. */ UnknownEnumValue(null); private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(LifecycleDetails.class); private final String value; private static java.util.Map map; static { map = new java.util.HashMap<>(); for (LifecycleDetails v : LifecycleDetails.values()) { if (v != UnknownEnumValue) { map.put(v.getValue(), v); } } } LifecycleDetails(String value) { this.value = value; } @com.fasterxml.jackson.annotation.JsonValue public String getValue() { return value; } @com.fasterxml.jackson.annotation.JsonCreator public static LifecycleDetails create(String key) { if (map.containsKey(key)) { return map.get(key); } LOG.warn( "Received unknown value '{}' for enum 'LifecycleDetails', returning UnknownEnumValue", key); return UnknownEnumValue; } }; /** Subscription resource intermediate states. */ @com.fasterxml.jackson.annotation.JsonProperty("lifecycleDetails") private final LifecycleDetails lifecycleDetails; /** * Subscription resource intermediate states. * * @return the value */ public LifecycleDetails getLifecycleDetails() { return lifecycleDetails; } /** Stock keeping unit. */ @com.fasterxml.jackson.annotation.JsonProperty("skus") private final java.util.List skus; /** * Stock keeping unit. * * @return the value */ public java.util.List getSkus() { return skus; } @Override public String toString() { return this.toString(true); } /** * Return a string representation of the object. * * @param includeByteArrayContents true to include the full contents of byte arrays * @return string representation */ public String toString(boolean includeByteArrayContents) { java.lang.StringBuilder sb = new java.lang.StringBuilder(); sb.append("Subscription("); sb.append("super=").append(super.toString()); sb.append("id=").append(String.valueOf(this.id)); sb.append(", classicSubscriptionId=").append(String.valueOf(this.classicSubscriptionId)); sb.append(", serviceName=").append(String.valueOf(this.serviceName)); sb.append(", lifecycleState=").append(String.valueOf(this.lifecycleState)); sb.append(", lifecycleDetails=").append(String.valueOf(this.lifecycleDetails)); sb.append(", skus=").append(String.valueOf(this.skus)); sb.append(")"); return sb.toString(); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Subscription)) { return false; } Subscription other = (Subscription) o; return java.util.Objects.equals(this.id, other.id) && java.util.Objects.equals(this.classicSubscriptionId, other.classicSubscriptionId) && java.util.Objects.equals(this.serviceName, other.serviceName) && java.util.Objects.equals(this.lifecycleState, other.lifecycleState) && java.util.Objects.equals(this.lifecycleDetails, other.lifecycleDetails) && java.util.Objects.equals(this.skus, other.skus) && super.equals(other); } @Override public int hashCode() { final int PRIME = 59; int result = 1; result = (result * PRIME) + (this.id == null ? 43 : this.id.hashCode()); result = (result * PRIME) + (this.classicSubscriptionId == null ? 43 : this.classicSubscriptionId.hashCode()); result = (result * PRIME) + (this.serviceName == null ? 43 : this.serviceName.hashCode()); result = (result * PRIME) + (this.lifecycleState == null ? 43 : this.lifecycleState.hashCode()); result = (result * PRIME) + (this.lifecycleDetails == null ? 43 : this.lifecycleDetails.hashCode()); result = (result * PRIME) + (this.skus == null ? 43 : this.skus.hashCode()); result = (result * PRIME) + super.hashCode(); return result; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy