/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ package com.amazonaws.services.licensemanager.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* A license configuration is an abstraction of a customer license agreement that can be consumed and enforced by * License Manager. Components include specifications for the license type (licensing by instance, socket, CPU, or * vCPU), allowed tenancy (shared tenancy, Dedicated Instance, Dedicated Host, or all of these), host affinity (how long * a VM must be associated with a host), and the number of licenses purchased and used. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class LicenseConfiguration implements Serializable, Cloneable, StructuredPojo { /** ** Unique ID of the license configuration. *
*/ private String licenseConfigurationId; /** ** Amazon Resource Name (ARN) of the license configuration. *
*/ private String licenseConfigurationArn; /** ** Name of the license configuration. *
*/ private String name; /** ** Description of the license configuration. *
*/ private String description; /** ** Dimension to use to track the license inventory. *
*/ private String licenseCountingType; /** ** License rules. *
*/ private java.util.List* Number of licenses managed by the license configuration. *
*/ private Long licenseCount; /** ** Number of available licenses as a hard limit. *
*/ private Boolean licenseCountHardLimit; /** ** When true, disassociates a resource when software is uninstalled. *
*/ private Boolean disassociateWhenNotFound; /** ** Number of licenses consumed. *
*/ private Long consumedLicenses; /** ** Status of the license configuration. *
*/ private String status; /** ** Account ID of the license configuration's owner. *
*/ private String ownerAccountId; /** ** Summaries for licenses consumed by various resources. *
*/ private java.util.List* Summaries for managed resources. *
*/ private java.util.List* Product information. *
*/ private java.util.List* Automated discovery information. *
*/ private AutomatedDiscoveryInformation automatedDiscoveryInformation; /** ** Unique ID of the license configuration. *
* * @param licenseConfigurationId * Unique ID of the license configuration. */ public void setLicenseConfigurationId(String licenseConfigurationId) { this.licenseConfigurationId = licenseConfigurationId; } /** ** Unique ID of the license configuration. *
* * @return Unique ID of the license configuration. */ public String getLicenseConfigurationId() { return this.licenseConfigurationId; } /** ** Unique ID of the license configuration. *
* * @param licenseConfigurationId * Unique ID of the license configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withLicenseConfigurationId(String licenseConfigurationId) { setLicenseConfigurationId(licenseConfigurationId); return this; } /** ** Amazon Resource Name (ARN) of the license configuration. *
* * @param licenseConfigurationArn * Amazon Resource Name (ARN) of the license configuration. */ public void setLicenseConfigurationArn(String licenseConfigurationArn) { this.licenseConfigurationArn = licenseConfigurationArn; } /** ** Amazon Resource Name (ARN) of the license configuration. *
* * @return Amazon Resource Name (ARN) of the license configuration. */ public String getLicenseConfigurationArn() { return this.licenseConfigurationArn; } /** ** Amazon Resource Name (ARN) of the license configuration. *
* * @param licenseConfigurationArn * Amazon Resource Name (ARN) of the license configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withLicenseConfigurationArn(String licenseConfigurationArn) { setLicenseConfigurationArn(licenseConfigurationArn); return this; } /** ** Name of the license configuration. *
* * @param name * Name of the license configuration. */ public void setName(String name) { this.name = name; } /** ** Name of the license configuration. *
* * @return Name of the license configuration. */ public String getName() { return this.name; } /** ** Name of the license configuration. *
* * @param name * Name of the license configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withName(String name) { setName(name); return this; } /** ** Description of the license configuration. *
* * @param description * Description of the license configuration. */ public void setDescription(String description) { this.description = description; } /** ** Description of the license configuration. *
* * @return Description of the license configuration. */ public String getDescription() { return this.description; } /** ** Description of the license configuration. *
* * @param description * Description of the license configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withDescription(String description) { setDescription(description); return this; } /** ** Dimension to use to track the license inventory. *
* * @param licenseCountingType * Dimension to use to track the license inventory. * @see LicenseCountingType */ public void setLicenseCountingType(String licenseCountingType) { this.licenseCountingType = licenseCountingType; } /** ** Dimension to use to track the license inventory. *
* * @return Dimension to use to track the license inventory. * @see LicenseCountingType */ public String getLicenseCountingType() { return this.licenseCountingType; } /** ** Dimension to use to track the license inventory. *
* * @param licenseCountingType * Dimension to use to track the license inventory. * @return Returns a reference to this object so that method calls can be chained together. * @see LicenseCountingType */ public LicenseConfiguration withLicenseCountingType(String licenseCountingType) { setLicenseCountingType(licenseCountingType); return this; } /** ** Dimension to use to track the license inventory. *
* * @param licenseCountingType * Dimension to use to track the license inventory. * @return Returns a reference to this object so that method calls can be chained together. * @see LicenseCountingType */ public LicenseConfiguration withLicenseCountingType(LicenseCountingType licenseCountingType) { this.licenseCountingType = licenseCountingType.toString(); return this; } /** ** License rules. *
* * @return License rules. */ public java.util.List* License rules. *
* * @param licenseRules * License rules. */ public void setLicenseRules(java.util.Collection* License rules. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setLicenseRules(java.util.Collection)} or {@link #withLicenseRules(java.util.Collection)} if you want to * override the existing values. *
* * @param licenseRules * License rules. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withLicenseRules(String... licenseRules) { if (this.licenseRules == null) { setLicenseRules(new java.util.ArrayList* License rules. *
* * @param licenseRules * License rules. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withLicenseRules(java.util.Collection* Number of licenses managed by the license configuration. *
* * @param licenseCount * Number of licenses managed by the license configuration. */ public void setLicenseCount(Long licenseCount) { this.licenseCount = licenseCount; } /** ** Number of licenses managed by the license configuration. *
* * @return Number of licenses managed by the license configuration. */ public Long getLicenseCount() { return this.licenseCount; } /** ** Number of licenses managed by the license configuration. *
* * @param licenseCount * Number of licenses managed by the license configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withLicenseCount(Long licenseCount) { setLicenseCount(licenseCount); return this; } /** ** Number of available licenses as a hard limit. *
* * @param licenseCountHardLimit * Number of available licenses as a hard limit. */ public void setLicenseCountHardLimit(Boolean licenseCountHardLimit) { this.licenseCountHardLimit = licenseCountHardLimit; } /** ** Number of available licenses as a hard limit. *
* * @return Number of available licenses as a hard limit. */ public Boolean getLicenseCountHardLimit() { return this.licenseCountHardLimit; } /** ** Number of available licenses as a hard limit. *
* * @param licenseCountHardLimit * Number of available licenses as a hard limit. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withLicenseCountHardLimit(Boolean licenseCountHardLimit) { setLicenseCountHardLimit(licenseCountHardLimit); return this; } /** ** Number of available licenses as a hard limit. *
* * @return Number of available licenses as a hard limit. */ public Boolean isLicenseCountHardLimit() { return this.licenseCountHardLimit; } /** ** When true, disassociates a resource when software is uninstalled. *
* * @param disassociateWhenNotFound * When true, disassociates a resource when software is uninstalled. */ public void setDisassociateWhenNotFound(Boolean disassociateWhenNotFound) { this.disassociateWhenNotFound = disassociateWhenNotFound; } /** ** When true, disassociates a resource when software is uninstalled. *
* * @return When true, disassociates a resource when software is uninstalled. */ public Boolean getDisassociateWhenNotFound() { return this.disassociateWhenNotFound; } /** ** When true, disassociates a resource when software is uninstalled. *
* * @param disassociateWhenNotFound * When true, disassociates a resource when software is uninstalled. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withDisassociateWhenNotFound(Boolean disassociateWhenNotFound) { setDisassociateWhenNotFound(disassociateWhenNotFound); return this; } /** ** When true, disassociates a resource when software is uninstalled. *
* * @return When true, disassociates a resource when software is uninstalled. */ public Boolean isDisassociateWhenNotFound() { return this.disassociateWhenNotFound; } /** ** Number of licenses consumed. *
* * @param consumedLicenses * Number of licenses consumed. */ public void setConsumedLicenses(Long consumedLicenses) { this.consumedLicenses = consumedLicenses; } /** ** Number of licenses consumed. *
* * @return Number of licenses consumed. */ public Long getConsumedLicenses() { return this.consumedLicenses; } /** ** Number of licenses consumed. *
* * @param consumedLicenses * Number of licenses consumed. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withConsumedLicenses(Long consumedLicenses) { setConsumedLicenses(consumedLicenses); return this; } /** ** Status of the license configuration. *
* * @param status * Status of the license configuration. */ public void setStatus(String status) { this.status = status; } /** ** Status of the license configuration. *
* * @return Status of the license configuration. */ public String getStatus() { return this.status; } /** ** Status of the license configuration. *
* * @param status * Status of the license configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withStatus(String status) { setStatus(status); return this; } /** ** Account ID of the license configuration's owner. *
* * @param ownerAccountId * Account ID of the license configuration's owner. */ public void setOwnerAccountId(String ownerAccountId) { this.ownerAccountId = ownerAccountId; } /** ** Account ID of the license configuration's owner. *
* * @return Account ID of the license configuration's owner. */ public String getOwnerAccountId() { return this.ownerAccountId; } /** ** Account ID of the license configuration's owner. *
* * @param ownerAccountId * Account ID of the license configuration's owner. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withOwnerAccountId(String ownerAccountId) { setOwnerAccountId(ownerAccountId); return this; } /** ** Summaries for licenses consumed by various resources. *
* * @return Summaries for licenses consumed by various resources. */ public java.util.List* Summaries for licenses consumed by various resources. *
* * @param consumedLicenseSummaryList * Summaries for licenses consumed by various resources. */ public void setConsumedLicenseSummaryList(java.util.Collection* Summaries for licenses consumed by various resources. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setConsumedLicenseSummaryList(java.util.Collection)} or * {@link #withConsumedLicenseSummaryList(java.util.Collection)} if you want to override the existing values. *
* * @param consumedLicenseSummaryList * Summaries for licenses consumed by various resources. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withConsumedLicenseSummaryList(ConsumedLicenseSummary... consumedLicenseSummaryList) { if (this.consumedLicenseSummaryList == null) { setConsumedLicenseSummaryList(new java.util.ArrayList* Summaries for licenses consumed by various resources. *
* * @param consumedLicenseSummaryList * Summaries for licenses consumed by various resources. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withConsumedLicenseSummaryList(java.util.Collection* Summaries for managed resources. *
* * @return Summaries for managed resources. */ public java.util.List* Summaries for managed resources. *
* * @param managedResourceSummaryList * Summaries for managed resources. */ public void setManagedResourceSummaryList(java.util.Collection* Summaries for managed resources. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setManagedResourceSummaryList(java.util.Collection)} or * {@link #withManagedResourceSummaryList(java.util.Collection)} if you want to override the existing values. *
* * @param managedResourceSummaryList * Summaries for managed resources. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withManagedResourceSummaryList(ManagedResourceSummary... managedResourceSummaryList) { if (this.managedResourceSummaryList == null) { setManagedResourceSummaryList(new java.util.ArrayList* Summaries for managed resources. *
* * @param managedResourceSummaryList * Summaries for managed resources. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withManagedResourceSummaryList(java.util.Collection* Product information. *
* * @return Product information. */ public java.util.List* Product information. *
* * @param productInformationList * Product information. */ public void setProductInformationList(java.util.Collection* Product information. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setProductInformationList(java.util.Collection)} or * {@link #withProductInformationList(java.util.Collection)} if you want to override the existing values. *
* * @param productInformationList * Product information. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withProductInformationList(ProductInformation... productInformationList) { if (this.productInformationList == null) { setProductInformationList(new java.util.ArrayList* Product information. *
* * @param productInformationList * Product information. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withProductInformationList(java.util.Collection* Automated discovery information. *
* * @param automatedDiscoveryInformation * Automated discovery information. */ public void setAutomatedDiscoveryInformation(AutomatedDiscoveryInformation automatedDiscoveryInformation) { this.automatedDiscoveryInformation = automatedDiscoveryInformation; } /** ** Automated discovery information. *
* * @return Automated discovery information. */ public AutomatedDiscoveryInformation getAutomatedDiscoveryInformation() { return this.automatedDiscoveryInformation; } /** ** Automated discovery information. *
* * @param automatedDiscoveryInformation * Automated discovery information. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseConfiguration withAutomatedDiscoveryInformation(AutomatedDiscoveryInformation automatedDiscoveryInformation) { setAutomatedDiscoveryInformation(automatedDiscoveryInformation); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getLicenseConfigurationId() != null) sb.append("LicenseConfigurationId: ").append(getLicenseConfigurationId()).append(","); if (getLicenseConfigurationArn() != null) sb.append("LicenseConfigurationArn: ").append(getLicenseConfigurationArn()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getLicenseCountingType() != null) sb.append("LicenseCountingType: ").append(getLicenseCountingType()).append(","); if (getLicenseRules() != null) sb.append("LicenseRules: ").append(getLicenseRules()).append(","); if (getLicenseCount() != null) sb.append("LicenseCount: ").append(getLicenseCount()).append(","); if (getLicenseCountHardLimit() != null) sb.append("LicenseCountHardLimit: ").append(getLicenseCountHardLimit()).append(","); if (getDisassociateWhenNotFound() != null) sb.append("DisassociateWhenNotFound: ").append(getDisassociateWhenNotFound()).append(","); if (getConsumedLicenses() != null) sb.append("ConsumedLicenses: ").append(getConsumedLicenses()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getOwnerAccountId() != null) sb.append("OwnerAccountId: ").append(getOwnerAccountId()).append(","); if (getConsumedLicenseSummaryList() != null) sb.append("ConsumedLicenseSummaryList: ").append(getConsumedLicenseSummaryList()).append(","); if (getManagedResourceSummaryList() != null) sb.append("ManagedResourceSummaryList: ").append(getManagedResourceSummaryList()).append(","); if (getProductInformationList() != null) sb.append("ProductInformationList: ").append(getProductInformationList()).append(","); if (getAutomatedDiscoveryInformation() != null) sb.append("AutomatedDiscoveryInformation: ").append(getAutomatedDiscoveryInformation()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof LicenseConfiguration == false) return false; LicenseConfiguration other = (LicenseConfiguration) obj; if (other.getLicenseConfigurationId() == null ^ this.getLicenseConfigurationId() == null) return false; if (other.getLicenseConfigurationId() != null && other.getLicenseConfigurationId().equals(this.getLicenseConfigurationId()) == false) return false; if (other.getLicenseConfigurationArn() == null ^ this.getLicenseConfigurationArn() == null) return false; if (other.getLicenseConfigurationArn() != null && other.getLicenseConfigurationArn().equals(this.getLicenseConfigurationArn()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getLicenseCountingType() == null ^ this.getLicenseCountingType() == null) return false; if (other.getLicenseCountingType() != null && other.getLicenseCountingType().equals(this.getLicenseCountingType()) == false) return false; if (other.getLicenseRules() == null ^ this.getLicenseRules() == null) return false; if (other.getLicenseRules() != null && other.getLicenseRules().equals(this.getLicenseRules()) == false) return false; if (other.getLicenseCount() == null ^ this.getLicenseCount() == null) return false; if (other.getLicenseCount() != null && other.getLicenseCount().equals(this.getLicenseCount()) == false) return false; if (other.getLicenseCountHardLimit() == null ^ this.getLicenseCountHardLimit() == null) return false; if (other.getLicenseCountHardLimit() != null && other.getLicenseCountHardLimit().equals(this.getLicenseCountHardLimit()) == false) return false; if (other.getDisassociateWhenNotFound() == null ^ this.getDisassociateWhenNotFound() == null) return false; if (other.getDisassociateWhenNotFound() != null && other.getDisassociateWhenNotFound().equals(this.getDisassociateWhenNotFound()) == false) return false; if (other.getConsumedLicenses() == null ^ this.getConsumedLicenses() == null) return false; if (other.getConsumedLicenses() != null && other.getConsumedLicenses().equals(this.getConsumedLicenses()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getOwnerAccountId() == null ^ this.getOwnerAccountId() == null) return false; if (other.getOwnerAccountId() != null && other.getOwnerAccountId().equals(this.getOwnerAccountId()) == false) return false; if (other.getConsumedLicenseSummaryList() == null ^ this.getConsumedLicenseSummaryList() == null) return false; if (other.getConsumedLicenseSummaryList() != null && other.getConsumedLicenseSummaryList().equals(this.getConsumedLicenseSummaryList()) == false) return false; if (other.getManagedResourceSummaryList() == null ^ this.getManagedResourceSummaryList() == null) return false; if (other.getManagedResourceSummaryList() != null && other.getManagedResourceSummaryList().equals(this.getManagedResourceSummaryList()) == false) return false; if (other.getProductInformationList() == null ^ this.getProductInformationList() == null) return false; if (other.getProductInformationList() != null && other.getProductInformationList().equals(this.getProductInformationList()) == false) return false; if (other.getAutomatedDiscoveryInformation() == null ^ this.getAutomatedDiscoveryInformation() == null) return false; if (other.getAutomatedDiscoveryInformation() != null && other.getAutomatedDiscoveryInformation().equals(this.getAutomatedDiscoveryInformation()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLicenseConfigurationId() == null) ? 0 : getLicenseConfigurationId().hashCode()); hashCode = prime * hashCode + ((getLicenseConfigurationArn() == null) ? 0 : getLicenseConfigurationArn().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getLicenseCountingType() == null) ? 0 : getLicenseCountingType().hashCode()); hashCode = prime * hashCode + ((getLicenseRules() == null) ? 0 : getLicenseRules().hashCode()); hashCode = prime * hashCode + ((getLicenseCount() == null) ? 0 : getLicenseCount().hashCode()); hashCode = prime * hashCode + ((getLicenseCountHardLimit() == null) ? 0 : getLicenseCountHardLimit().hashCode()); hashCode = prime * hashCode + ((getDisassociateWhenNotFound() == null) ? 0 : getDisassociateWhenNotFound().hashCode()); hashCode = prime * hashCode + ((getConsumedLicenses() == null) ? 0 : getConsumedLicenses().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getOwnerAccountId() == null) ? 0 : getOwnerAccountId().hashCode()); hashCode = prime * hashCode + ((getConsumedLicenseSummaryList() == null) ? 0 : getConsumedLicenseSummaryList().hashCode()); hashCode = prime * hashCode + ((getManagedResourceSummaryList() == null) ? 0 : getManagedResourceSummaryList().hashCode()); hashCode = prime * hashCode + ((getProductInformationList() == null) ? 0 : getProductInformationList().hashCode()); hashCode = prime * hashCode + ((getAutomatedDiscoveryInformation() == null) ? 0 : getAutomatedDiscoveryInformation().hashCode()); return hashCode; } @Override public LicenseConfiguration clone() { try { return (LicenseConfiguration) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.licensemanager.model.transform.LicenseConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller); } }