/* * 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.AmazonWebServiceRequest; /** * * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateLicenseConfigurationRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* Name of the license configuration. *

*/ private String name; /** *

* Description of the license configuration. *

*/ private String description; /** *

* Dimension used to track the license inventory. *

*/ private String licenseCountingType; /** *

* Number of licenses managed by the license configuration. *

*/ private Long licenseCount; /** *

* Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new * instances. *

*/ private Boolean licenseCountHardLimit; /** *

* License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules * vary by dimension, as follows. *

* *

* The unit for licenseAffinityToHost is days and the range is 1 to 180. The possible values for * allowedTenancy are EC2-Default, EC2-DedicatedHost, and * EC2-DedicatedInstance. The possible values for honorVcpuOptimization are * True and False. *

*/ private java.util.List licenseRules; /** *

* Tags to add to the license configuration. *

*/ private java.util.List tags; /** *

* When true, disassociates a resource when software is uninstalled. *

*/ private Boolean disassociateWhenNotFound; /** *

* Product information. *

*/ private java.util.List productInformationList; /** *

* 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 CreateLicenseConfigurationRequest 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 CreateLicenseConfigurationRequest withDescription(String description) { setDescription(description); return this; } /** *

* Dimension used to track the license inventory. *

* * @param licenseCountingType * Dimension used to track the license inventory. * @see LicenseCountingType */ public void setLicenseCountingType(String licenseCountingType) { this.licenseCountingType = licenseCountingType; } /** *

* Dimension used to track the license inventory. *

* * @return Dimension used to track the license inventory. * @see LicenseCountingType */ public String getLicenseCountingType() { return this.licenseCountingType; } /** *

* Dimension used to track the license inventory. *

* * @param licenseCountingType * Dimension used to track the license inventory. * @return Returns a reference to this object so that method calls can be chained together. * @see LicenseCountingType */ public CreateLicenseConfigurationRequest withLicenseCountingType(String licenseCountingType) { setLicenseCountingType(licenseCountingType); return this; } /** *

* Dimension used to track the license inventory. *

* * @param licenseCountingType * Dimension used to track the license inventory. * @return Returns a reference to this object so that method calls can be chained together. * @see LicenseCountingType */ public CreateLicenseConfigurationRequest withLicenseCountingType(LicenseCountingType licenseCountingType) { this.licenseCountingType = licenseCountingType.toString(); return this; } /** *

* 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 CreateLicenseConfigurationRequest withLicenseCount(Long licenseCount) { setLicenseCount(licenseCount); return this; } /** *

* Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new * instances. *

* * @param licenseCountHardLimit * Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of * new instances. */ public void setLicenseCountHardLimit(Boolean licenseCountHardLimit) { this.licenseCountHardLimit = licenseCountHardLimit; } /** *

* Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new * instances. *

* * @return Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of * new instances. */ public Boolean getLicenseCountHardLimit() { return this.licenseCountHardLimit; } /** *

* Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new * instances. *

* * @param licenseCountHardLimit * Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of * new instances. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseConfigurationRequest withLicenseCountHardLimit(Boolean licenseCountHardLimit) { setLicenseCountHardLimit(licenseCountHardLimit); return this; } /** *

* Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new * instances. *

* * @return Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of * new instances. */ public Boolean isLicenseCountHardLimit() { return this.licenseCountHardLimit; } /** *

* License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules * vary by dimension, as follows. *

*
    *
  • *

    * Cores dimension: allowedTenancy | licenseAffinityToHost | * maximumCores | minimumCores *

    *
  • *
  • *

    * Instances dimension: allowedTenancy | maximumCores | * minimumCores | maximumSockets | minimumSockets | maximumVcpus * | minimumVcpus *

    *
  • *
  • *

    * Sockets dimension: allowedTenancy | licenseAffinityToHost | * maximumSockets | minimumSockets *

    *
  • *
  • *

    * vCPUs dimension: allowedTenancy | honorVcpuOptimization | * maximumVcpus | minimumVcpus *

    *
  • *
*

* The unit for licenseAffinityToHost is days and the range is 1 to 180. The possible values for * allowedTenancy are EC2-Default, EC2-DedicatedHost, and * EC2-DedicatedInstance. The possible values for honorVcpuOptimization are * True and False. *

* * @return License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available * rules vary by dimension, as follows.

*
    *
  • *

    * Cores dimension: allowedTenancy | licenseAffinityToHost | * maximumCores | minimumCores *

    *
  • *
  • *

    * Instances dimension: allowedTenancy | maximumCores | * minimumCores | maximumSockets | minimumSockets | * maximumVcpus | minimumVcpus *

    *
  • *
  • *

    * Sockets dimension: allowedTenancy | licenseAffinityToHost | * maximumSockets | minimumSockets *

    *
  • *
  • *

    * vCPUs dimension: allowedTenancy | honorVcpuOptimization | * maximumVcpus | minimumVcpus *

    *
  • *
*

* The unit for licenseAffinityToHost is days and the range is 1 to 180. The possible values * for allowedTenancy are EC2-Default, EC2-DedicatedHost, and * EC2-DedicatedInstance. The possible values for honorVcpuOptimization are * True and False. */ public java.util.List getLicenseRules() { return licenseRules; } /** *

* License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules * vary by dimension, as follows. *

*
    *
  • *

    * Cores dimension: allowedTenancy | licenseAffinityToHost | * maximumCores | minimumCores *

    *
  • *
  • *

    * Instances dimension: allowedTenancy | maximumCores | * minimumCores | maximumSockets | minimumSockets | maximumVcpus * | minimumVcpus *

    *
  • *
  • *

    * Sockets dimension: allowedTenancy | licenseAffinityToHost | * maximumSockets | minimumSockets *

    *
  • *
  • *

    * vCPUs dimension: allowedTenancy | honorVcpuOptimization | * maximumVcpus | minimumVcpus *

    *
  • *
*

* The unit for licenseAffinityToHost is days and the range is 1 to 180. The possible values for * allowedTenancy are EC2-Default, EC2-DedicatedHost, and * EC2-DedicatedInstance. The possible values for honorVcpuOptimization are * True and False. *

* * @param licenseRules * License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available * rules vary by dimension, as follows.

*
    *
  • *

    * Cores dimension: allowedTenancy | licenseAffinityToHost | * maximumCores | minimumCores *

    *
  • *
  • *

    * Instances dimension: allowedTenancy | maximumCores | * minimumCores | maximumSockets | minimumSockets | * maximumVcpus | minimumVcpus *

    *
  • *
  • *

    * Sockets dimension: allowedTenancy | licenseAffinityToHost | * maximumSockets | minimumSockets *

    *
  • *
  • *

    * vCPUs dimension: allowedTenancy | honorVcpuOptimization | * maximumVcpus | minimumVcpus *

    *
  • *
*

* The unit for licenseAffinityToHost is days and the range is 1 to 180. The possible values for * allowedTenancy are EC2-Default, EC2-DedicatedHost, and * EC2-DedicatedInstance. The possible values for honorVcpuOptimization are * True and False. */ public void setLicenseRules(java.util.Collection licenseRules) { if (licenseRules == null) { this.licenseRules = null; return; } this.licenseRules = new java.util.ArrayList(licenseRules); } /** *

* License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules * vary by dimension, as follows. *

*
    *
  • *

    * Cores dimension: allowedTenancy | licenseAffinityToHost | * maximumCores | minimumCores *

    *
  • *
  • *

    * Instances dimension: allowedTenancy | maximumCores | * minimumCores | maximumSockets | minimumSockets | maximumVcpus * | minimumVcpus *

    *
  • *
  • *

    * Sockets dimension: allowedTenancy | licenseAffinityToHost | * maximumSockets | minimumSockets *

    *
  • *
  • *

    * vCPUs dimension: allowedTenancy | honorVcpuOptimization | * maximumVcpus | minimumVcpus *

    *
  • *
*

* The unit for licenseAffinityToHost is days and the range is 1 to 180. The possible values for * allowedTenancy are EC2-Default, EC2-DedicatedHost, and * EC2-DedicatedInstance. The possible values for honorVcpuOptimization are * True and False. *

*

* 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. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available * rules vary by dimension, as follows.

*
    *
  • *

    * Cores dimension: allowedTenancy | licenseAffinityToHost | * maximumCores | minimumCores *

    *
  • *
  • *

    * Instances dimension: allowedTenancy | maximumCores | * minimumCores | maximumSockets | minimumSockets | * maximumVcpus | minimumVcpus *

    *
  • *
  • *

    * Sockets dimension: allowedTenancy | licenseAffinityToHost | * maximumSockets | minimumSockets *

    *
  • *
  • *

    * vCPUs dimension: allowedTenancy | honorVcpuOptimization | * maximumVcpus | minimumVcpus *

    *
  • *
*

* The unit for licenseAffinityToHost is days and the range is 1 to 180. The possible values for * allowedTenancy are EC2-Default, EC2-DedicatedHost, and * EC2-DedicatedInstance. The possible values for honorVcpuOptimization are * True and False. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseConfigurationRequest withLicenseRules(String... licenseRules) { if (this.licenseRules == null) { setLicenseRules(new java.util.ArrayList(licenseRules.length)); } for (String ele : licenseRules) { this.licenseRules.add(ele); } return this; } /** *

* License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules * vary by dimension, as follows. *

*
    *
  • *

    * Cores dimension: allowedTenancy | licenseAffinityToHost | * maximumCores | minimumCores *

    *
  • *
  • *

    * Instances dimension: allowedTenancy | maximumCores | * minimumCores | maximumSockets | minimumSockets | maximumVcpus * | minimumVcpus *

    *
  • *
  • *

    * Sockets dimension: allowedTenancy | licenseAffinityToHost | * maximumSockets | minimumSockets *

    *
  • *
  • *

    * vCPUs dimension: allowedTenancy | honorVcpuOptimization | * maximumVcpus | minimumVcpus *

    *
  • *
*

* The unit for licenseAffinityToHost is days and the range is 1 to 180. The possible values for * allowedTenancy are EC2-Default, EC2-DedicatedHost, and * EC2-DedicatedInstance. The possible values for honorVcpuOptimization are * True and False. *

* * @param licenseRules * License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available * rules vary by dimension, as follows.

*
    *
  • *

    * Cores dimension: allowedTenancy | licenseAffinityToHost | * maximumCores | minimumCores *

    *
  • *
  • *

    * Instances dimension: allowedTenancy | maximumCores | * minimumCores | maximumSockets | minimumSockets | * maximumVcpus | minimumVcpus *

    *
  • *
  • *

    * Sockets dimension: allowedTenancy | licenseAffinityToHost | * maximumSockets | minimumSockets *

    *
  • *
  • *

    * vCPUs dimension: allowedTenancy | honorVcpuOptimization | * maximumVcpus | minimumVcpus *

    *
  • *
*

* The unit for licenseAffinityToHost is days and the range is 1 to 180. The possible values for * allowedTenancy are EC2-Default, EC2-DedicatedHost, and * EC2-DedicatedInstance. The possible values for honorVcpuOptimization are * True and False. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseConfigurationRequest withLicenseRules(java.util.Collection licenseRules) { setLicenseRules(licenseRules); return this; } /** *

* Tags to add to the license configuration. *

* * @return Tags to add to the license configuration. */ public java.util.List getTags() { return tags; } /** *

* Tags to add to the license configuration. *

* * @param tags * Tags to add to the license configuration. */ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* Tags to add to the license configuration. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *

* * @param tags * Tags to add to the license configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseConfigurationRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; } /** *

* Tags to add to the license configuration. *

* * @param tags * Tags to add to the license configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseConfigurationRequest withTags(java.util.Collection tags) { setTags(tags); return this; } /** *

* 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 CreateLicenseConfigurationRequest 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; } /** *

* Product information. *

* * @return Product information. */ public java.util.List getProductInformationList() { return productInformationList; } /** *

* Product information. *

* * @param productInformationList * Product information. */ public void setProductInformationList(java.util.Collection productInformationList) { if (productInformationList == null) { this.productInformationList = null; return; } this.productInformationList = new java.util.ArrayList(productInformationList); } /** *

* 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 CreateLicenseConfigurationRequest withProductInformationList(ProductInformation... productInformationList) { if (this.productInformationList == null) { setProductInformationList(new java.util.ArrayList(productInformationList.length)); } for (ProductInformation ele : productInformationList) { this.productInformationList.add(ele); } return this; } /** *

* Product information. *

* * @param productInformationList * Product information. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseConfigurationRequest withProductInformationList(java.util.Collection productInformationList) { setProductInformationList(productInformationList); 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 (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 (getLicenseCount() != null) sb.append("LicenseCount: ").append(getLicenseCount()).append(","); if (getLicenseCountHardLimit() != null) sb.append("LicenseCountHardLimit: ").append(getLicenseCountHardLimit()).append(","); if (getLicenseRules() != null) sb.append("LicenseRules: ").append(getLicenseRules()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getDisassociateWhenNotFound() != null) sb.append("DisassociateWhenNotFound: ").append(getDisassociateWhenNotFound()).append(","); if (getProductInformationList() != null) sb.append("ProductInformationList: ").append(getProductInformationList()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateLicenseConfigurationRequest == false) return false; CreateLicenseConfigurationRequest other = (CreateLicenseConfigurationRequest) obj; 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.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.getLicenseRules() == null ^ this.getLicenseRules() == null) return false; if (other.getLicenseRules() != null && other.getLicenseRules().equals(this.getLicenseRules()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == 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.getProductInformationList() == null ^ this.getProductInformationList() == null) return false; if (other.getProductInformationList() != null && other.getProductInformationList().equals(this.getProductInformationList()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; 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 + ((getLicenseCount() == null) ? 0 : getLicenseCount().hashCode()); hashCode = prime * hashCode + ((getLicenseCountHardLimit() == null) ? 0 : getLicenseCountHardLimit().hashCode()); hashCode = prime * hashCode + ((getLicenseRules() == null) ? 0 : getLicenseRules().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getDisassociateWhenNotFound() == null) ? 0 : getDisassociateWhenNotFound().hashCode()); hashCode = prime * hashCode + ((getProductInformationList() == null) ? 0 : getProductInformationList().hashCode()); return hashCode; } @Override public CreateLicenseConfigurationRequest clone() { return (CreateLicenseConfigurationRequest) super.clone(); } }