/* * 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 CreateLicenseVersionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* Amazon Resource Name (ARN) of the license. *
*/ private String licenseArn; /** ** License name. *
*/ private String licenseName; /** ** Product name. *
*/ private String productName; /** ** License issuer. *
*/ private Issuer issuer; /** ** Home Region of the license. *
*/ private String homeRegion; /** ** Date and time range during which the license is valid, in ISO8601-UTC format. *
*/ private DatetimeRange validity; /** ** Information about the license. *
*/ private java.util.List* License entitlements. *
*/ private java.util.List* Configuration for consumption of the license. Choose a provisional configuration for workloads running with * continuous connectivity. Choose a borrow configuration for workloads with offline usage. *
*/ private ConsumptionConfiguration consumptionConfiguration; /** ** License status. *
*/ private String status; /** ** Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. *
*/ private String clientToken; /** ** Current version of the license. *
*/ private String sourceVersion; /** ** Amazon Resource Name (ARN) of the license. *
* * @param licenseArn * Amazon Resource Name (ARN) of the license. */ public void setLicenseArn(String licenseArn) { this.licenseArn = licenseArn; } /** ** Amazon Resource Name (ARN) of the license. *
* * @return Amazon Resource Name (ARN) of the license. */ public String getLicenseArn() { return this.licenseArn; } /** ** Amazon Resource Name (ARN) of the license. *
* * @param licenseArn * Amazon Resource Name (ARN) of the license. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withLicenseArn(String licenseArn) { setLicenseArn(licenseArn); return this; } /** ** License name. *
* * @param licenseName * License name. */ public void setLicenseName(String licenseName) { this.licenseName = licenseName; } /** ** License name. *
* * @return License name. */ public String getLicenseName() { return this.licenseName; } /** ** License name. *
* * @param licenseName * License name. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withLicenseName(String licenseName) { setLicenseName(licenseName); return this; } /** ** Product name. *
* * @param productName * Product name. */ public void setProductName(String productName) { this.productName = productName; } /** ** Product name. *
* * @return Product name. */ public String getProductName() { return this.productName; } /** ** Product name. *
* * @param productName * Product name. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withProductName(String productName) { setProductName(productName); return this; } /** ** License issuer. *
* * @param issuer * License issuer. */ public void setIssuer(Issuer issuer) { this.issuer = issuer; } /** ** License issuer. *
* * @return License issuer. */ public Issuer getIssuer() { return this.issuer; } /** ** License issuer. *
* * @param issuer * License issuer. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withIssuer(Issuer issuer) { setIssuer(issuer); return this; } /** ** Home Region of the license. *
* * @param homeRegion * Home Region of the license. */ public void setHomeRegion(String homeRegion) { this.homeRegion = homeRegion; } /** ** Home Region of the license. *
* * @return Home Region of the license. */ public String getHomeRegion() { return this.homeRegion; } /** ** Home Region of the license. *
* * @param homeRegion * Home Region of the license. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withHomeRegion(String homeRegion) { setHomeRegion(homeRegion); return this; } /** ** Date and time range during which the license is valid, in ISO8601-UTC format. *
* * @param validity * Date and time range during which the license is valid, in ISO8601-UTC format. */ public void setValidity(DatetimeRange validity) { this.validity = validity; } /** ** Date and time range during which the license is valid, in ISO8601-UTC format. *
* * @return Date and time range during which the license is valid, in ISO8601-UTC format. */ public DatetimeRange getValidity() { return this.validity; } /** ** Date and time range during which the license is valid, in ISO8601-UTC format. *
* * @param validity * Date and time range during which the license is valid, in ISO8601-UTC format. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withValidity(DatetimeRange validity) { setValidity(validity); return this; } /** ** Information about the license. *
* * @return Information about the license. */ public java.util.List* Information about the license. *
* * @param licenseMetadata * Information about the license. */ public void setLicenseMetadata(java.util.Collection* Information about the license. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setLicenseMetadata(java.util.Collection)} or {@link #withLicenseMetadata(java.util.Collection)} if you * want to override the existing values. *
* * @param licenseMetadata * Information about the license. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withLicenseMetadata(Metadata... licenseMetadata) { if (this.licenseMetadata == null) { setLicenseMetadata(new java.util.ArrayList* Information about the license. *
* * @param licenseMetadata * Information about the license. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withLicenseMetadata(java.util.Collection* License entitlements. *
* * @return License entitlements. */ public java.util.List* License entitlements. *
* * @param entitlements * License entitlements. */ public void setEntitlements(java.util.Collection* License entitlements. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setEntitlements(java.util.Collection)} or {@link #withEntitlements(java.util.Collection)} if you want to * override the existing values. *
* * @param entitlements * License entitlements. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withEntitlements(Entitlement... entitlements) { if (this.entitlements == null) { setEntitlements(new java.util.ArrayList* License entitlements. *
* * @param entitlements * License entitlements. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withEntitlements(java.util.Collection* Configuration for consumption of the license. Choose a provisional configuration for workloads running with * continuous connectivity. Choose a borrow configuration for workloads with offline usage. *
* * @param consumptionConfiguration * Configuration for consumption of the license. Choose a provisional configuration for workloads running * with continuous connectivity. Choose a borrow configuration for workloads with offline usage. */ public void setConsumptionConfiguration(ConsumptionConfiguration consumptionConfiguration) { this.consumptionConfiguration = consumptionConfiguration; } /** ** Configuration for consumption of the license. Choose a provisional configuration for workloads running with * continuous connectivity. Choose a borrow configuration for workloads with offline usage. *
* * @return Configuration for consumption of the license. Choose a provisional configuration for workloads running * with continuous connectivity. Choose a borrow configuration for workloads with offline usage. */ public ConsumptionConfiguration getConsumptionConfiguration() { return this.consumptionConfiguration; } /** ** Configuration for consumption of the license. Choose a provisional configuration for workloads running with * continuous connectivity. Choose a borrow configuration for workloads with offline usage. *
* * @param consumptionConfiguration * Configuration for consumption of the license. Choose a provisional configuration for workloads running * with continuous connectivity. Choose a borrow configuration for workloads with offline usage. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withConsumptionConfiguration(ConsumptionConfiguration consumptionConfiguration) { setConsumptionConfiguration(consumptionConfiguration); return this; } /** ** License status. *
* * @param status * License status. * @see LicenseStatus */ public void setStatus(String status) { this.status = status; } /** ** License status. *
* * @return License status. * @see LicenseStatus */ public String getStatus() { return this.status; } /** ** License status. *
* * @param status * License status. * @return Returns a reference to this object so that method calls can be chained together. * @see LicenseStatus */ public CreateLicenseVersionRequest withStatus(String status) { setStatus(status); return this; } /** ** License status. *
* * @param status * License status. * @return Returns a reference to this object so that method calls can be chained together. * @see LicenseStatus */ public CreateLicenseVersionRequest withStatus(LicenseStatus status) { this.status = status.toString(); return this; } /** ** Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. *
* * @param clientToken * Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. */ public void setClientToken(String clientToken) { this.clientToken = clientToken; } /** ** Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. *
* * @return Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. */ public String getClientToken() { return this.clientToken; } /** ** Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. *
* * @param clientToken * Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withClientToken(String clientToken) { setClientToken(clientToken); return this; } /** ** Current version of the license. *
* * @param sourceVersion * Current version of the license. */ public void setSourceVersion(String sourceVersion) { this.sourceVersion = sourceVersion; } /** ** Current version of the license. *
* * @return Current version of the license. */ public String getSourceVersion() { return this.sourceVersion; } /** ** Current version of the license. *
* * @param sourceVersion * Current version of the license. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLicenseVersionRequest withSourceVersion(String sourceVersion) { setSourceVersion(sourceVersion); 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 (getLicenseArn() != null) sb.append("LicenseArn: ").append(getLicenseArn()).append(","); if (getLicenseName() != null) sb.append("LicenseName: ").append(getLicenseName()).append(","); if (getProductName() != null) sb.append("ProductName: ").append(getProductName()).append(","); if (getIssuer() != null) sb.append("Issuer: ").append(getIssuer()).append(","); if (getHomeRegion() != null) sb.append("HomeRegion: ").append(getHomeRegion()).append(","); if (getValidity() != null) sb.append("Validity: ").append(getValidity()).append(","); if (getLicenseMetadata() != null) sb.append("LicenseMetadata: ").append(getLicenseMetadata()).append(","); if (getEntitlements() != null) sb.append("Entitlements: ").append(getEntitlements()).append(","); if (getConsumptionConfiguration() != null) sb.append("ConsumptionConfiguration: ").append(getConsumptionConfiguration()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getClientToken() != null) sb.append("ClientToken: ").append(getClientToken()).append(","); if (getSourceVersion() != null) sb.append("SourceVersion: ").append(getSourceVersion()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateLicenseVersionRequest == false) return false; CreateLicenseVersionRequest other = (CreateLicenseVersionRequest) obj; if (other.getLicenseArn() == null ^ this.getLicenseArn() == null) return false; if (other.getLicenseArn() != null && other.getLicenseArn().equals(this.getLicenseArn()) == false) return false; if (other.getLicenseName() == null ^ this.getLicenseName() == null) return false; if (other.getLicenseName() != null && other.getLicenseName().equals(this.getLicenseName()) == false) return false; if (other.getProductName() == null ^ this.getProductName() == null) return false; if (other.getProductName() != null && other.getProductName().equals(this.getProductName()) == false) return false; if (other.getIssuer() == null ^ this.getIssuer() == null) return false; if (other.getIssuer() != null && other.getIssuer().equals(this.getIssuer()) == false) return false; if (other.getHomeRegion() == null ^ this.getHomeRegion() == null) return false; if (other.getHomeRegion() != null && other.getHomeRegion().equals(this.getHomeRegion()) == false) return false; if (other.getValidity() == null ^ this.getValidity() == null) return false; if (other.getValidity() != null && other.getValidity().equals(this.getValidity()) == false) return false; if (other.getLicenseMetadata() == null ^ this.getLicenseMetadata() == null) return false; if (other.getLicenseMetadata() != null && other.getLicenseMetadata().equals(this.getLicenseMetadata()) == false) return false; if (other.getEntitlements() == null ^ this.getEntitlements() == null) return false; if (other.getEntitlements() != null && other.getEntitlements().equals(this.getEntitlements()) == false) return false; if (other.getConsumptionConfiguration() == null ^ this.getConsumptionConfiguration() == null) return false; if (other.getConsumptionConfiguration() != null && other.getConsumptionConfiguration().equals(this.getConsumptionConfiguration()) == 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.getClientToken() == null ^ this.getClientToken() == null) return false; if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false) return false; if (other.getSourceVersion() == null ^ this.getSourceVersion() == null) return false; if (other.getSourceVersion() != null && other.getSourceVersion().equals(this.getSourceVersion()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLicenseArn() == null) ? 0 : getLicenseArn().hashCode()); hashCode = prime * hashCode + ((getLicenseName() == null) ? 0 : getLicenseName().hashCode()); hashCode = prime * hashCode + ((getProductName() == null) ? 0 : getProductName().hashCode()); hashCode = prime * hashCode + ((getIssuer() == null) ? 0 : getIssuer().hashCode()); hashCode = prime * hashCode + ((getHomeRegion() == null) ? 0 : getHomeRegion().hashCode()); hashCode = prime * hashCode + ((getValidity() == null) ? 0 : getValidity().hashCode()); hashCode = prime * hashCode + ((getLicenseMetadata() == null) ? 0 : getLicenseMetadata().hashCode()); hashCode = prime * hashCode + ((getEntitlements() == null) ? 0 : getEntitlements().hashCode()); hashCode = prime * hashCode + ((getConsumptionConfiguration() == null) ? 0 : getConsumptionConfiguration().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); hashCode = prime * hashCode + ((getSourceVersion() == null) ? 0 : getSourceVersion().hashCode()); return hashCode; } @Override public CreateLicenseVersionRequest clone() { return (CreateLicenseVersionRequest) super.clone(); } }