/* * 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 CheckoutBorrowLicenseRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* Amazon Resource Name (ARN) of the license. The license must use the borrow consumption configuration. *

*/ private String licenseArn; /** *

* License entitlements. Partial checkouts are not supported. *

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

* Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more information, * see RFC 7518 Digital Signature with RSASSA-PSS. *

*/ private String digitalSignatureMethod; /** *

* Node ID. *

*/ private String nodeId; /** *

* Information about constraints. *

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

* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. *

*/ private String clientToken; /** *

* Amazon Resource Name (ARN) of the license. The license must use the borrow consumption configuration. *

* * @param licenseArn * Amazon Resource Name (ARN) of the license. The license must use the borrow consumption configuration. */ public void setLicenseArn(String licenseArn) { this.licenseArn = licenseArn; } /** *

* Amazon Resource Name (ARN) of the license. The license must use the borrow consumption configuration. *

* * @return Amazon Resource Name (ARN) of the license. The license must use the borrow consumption configuration. */ public String getLicenseArn() { return this.licenseArn; } /** *

* Amazon Resource Name (ARN) of the license. The license must use the borrow consumption configuration. *

* * @param licenseArn * Amazon Resource Name (ARN) of the license. The license must use the borrow consumption configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutBorrowLicenseRequest withLicenseArn(String licenseArn) { setLicenseArn(licenseArn); return this; } /** *

* License entitlements. Partial checkouts are not supported. *

* * @return License entitlements. Partial checkouts are not supported. */ public java.util.List getEntitlements() { return entitlements; } /** *

* License entitlements. Partial checkouts are not supported. *

* * @param entitlements * License entitlements. Partial checkouts are not supported. */ public void setEntitlements(java.util.Collection entitlements) { if (entitlements == null) { this.entitlements = null; return; } this.entitlements = new java.util.ArrayList(entitlements); } /** *

* License entitlements. Partial checkouts are not supported. *

*

* 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. Partial checkouts are not supported. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutBorrowLicenseRequest withEntitlements(EntitlementData... entitlements) { if (this.entitlements == null) { setEntitlements(new java.util.ArrayList(entitlements.length)); } for (EntitlementData ele : entitlements) { this.entitlements.add(ele); } return this; } /** *

* License entitlements. Partial checkouts are not supported. *

* * @param entitlements * License entitlements. Partial checkouts are not supported. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutBorrowLicenseRequest withEntitlements(java.util.Collection entitlements) { setEntitlements(entitlements); return this; } /** *

* Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more information, * see RFC 7518 Digital Signature with RSASSA-PSS. *

* * @param digitalSignatureMethod * Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more * information, see RFC 7518 Digital Signature with * RSASSA-PSS. * @see DigitalSignatureMethod */ public void setDigitalSignatureMethod(String digitalSignatureMethod) { this.digitalSignatureMethod = digitalSignatureMethod; } /** *

* Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more information, * see RFC 7518 Digital Signature with RSASSA-PSS. *

* * @return Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more * information, see RFC 7518 Digital Signature * with RSASSA-PSS. * @see DigitalSignatureMethod */ public String getDigitalSignatureMethod() { return this.digitalSignatureMethod; } /** *

* Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more information, * see RFC 7518 Digital Signature with RSASSA-PSS. *

* * @param digitalSignatureMethod * Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more * information, see RFC 7518 Digital Signature with * RSASSA-PSS. * @return Returns a reference to this object so that method calls can be chained together. * @see DigitalSignatureMethod */ public CheckoutBorrowLicenseRequest withDigitalSignatureMethod(String digitalSignatureMethod) { setDigitalSignatureMethod(digitalSignatureMethod); return this; } /** *

* Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more information, * see RFC 7518 Digital Signature with RSASSA-PSS. *

* * @param digitalSignatureMethod * Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more * information, see RFC 7518 Digital Signature with * RSASSA-PSS. * @return Returns a reference to this object so that method calls can be chained together. * @see DigitalSignatureMethod */ public CheckoutBorrowLicenseRequest withDigitalSignatureMethod(DigitalSignatureMethod digitalSignatureMethod) { this.digitalSignatureMethod = digitalSignatureMethod.toString(); return this; } /** *

* Node ID. *

* * @param nodeId * Node ID. */ public void setNodeId(String nodeId) { this.nodeId = nodeId; } /** *

* Node ID. *

* * @return Node ID. */ public String getNodeId() { return this.nodeId; } /** *

* Node ID. *

* * @param nodeId * Node ID. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutBorrowLicenseRequest withNodeId(String nodeId) { setNodeId(nodeId); return this; } /** *

* Information about constraints. *

* * @return Information about constraints. */ public java.util.List getCheckoutMetadata() { return checkoutMetadata; } /** *

* Information about constraints. *

* * @param checkoutMetadata * Information about constraints. */ public void setCheckoutMetadata(java.util.Collection checkoutMetadata) { if (checkoutMetadata == null) { this.checkoutMetadata = null; return; } this.checkoutMetadata = new java.util.ArrayList(checkoutMetadata); } /** *

* Information about constraints. *

*

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

* * @param checkoutMetadata * Information about constraints. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutBorrowLicenseRequest withCheckoutMetadata(Metadata... checkoutMetadata) { if (this.checkoutMetadata == null) { setCheckoutMetadata(new java.util.ArrayList(checkoutMetadata.length)); } for (Metadata ele : checkoutMetadata) { this.checkoutMetadata.add(ele); } return this; } /** *

* Information about constraints. *

* * @param checkoutMetadata * Information about constraints. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutBorrowLicenseRequest withCheckoutMetadata(java.util.Collection checkoutMetadata) { setCheckoutMetadata(checkoutMetadata); 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 CheckoutBorrowLicenseRequest withClientToken(String clientToken) { setClientToken(clientToken); 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 (getEntitlements() != null) sb.append("Entitlements: ").append(getEntitlements()).append(","); if (getDigitalSignatureMethod() != null) sb.append("DigitalSignatureMethod: ").append(getDigitalSignatureMethod()).append(","); if (getNodeId() != null) sb.append("NodeId: ").append(getNodeId()).append(","); if (getCheckoutMetadata() != null) sb.append("CheckoutMetadata: ").append(getCheckoutMetadata()).append(","); if (getClientToken() != null) sb.append("ClientToken: ").append(getClientToken()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CheckoutBorrowLicenseRequest == false) return false; CheckoutBorrowLicenseRequest other = (CheckoutBorrowLicenseRequest) obj; if (other.getLicenseArn() == null ^ this.getLicenseArn() == null) return false; if (other.getLicenseArn() != null && other.getLicenseArn().equals(this.getLicenseArn()) == 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.getDigitalSignatureMethod() == null ^ this.getDigitalSignatureMethod() == null) return false; if (other.getDigitalSignatureMethod() != null && other.getDigitalSignatureMethod().equals(this.getDigitalSignatureMethod()) == false) return false; if (other.getNodeId() == null ^ this.getNodeId() == null) return false; if (other.getNodeId() != null && other.getNodeId().equals(this.getNodeId()) == false) return false; if (other.getCheckoutMetadata() == null ^ this.getCheckoutMetadata() == null) return false; if (other.getCheckoutMetadata() != null && other.getCheckoutMetadata().equals(this.getCheckoutMetadata()) == false) return false; if (other.getClientToken() == null ^ this.getClientToken() == null) return false; if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == 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 + ((getEntitlements() == null) ? 0 : getEntitlements().hashCode()); hashCode = prime * hashCode + ((getDigitalSignatureMethod() == null) ? 0 : getDigitalSignatureMethod().hashCode()); hashCode = prime * hashCode + ((getNodeId() == null) ? 0 : getNodeId().hashCode()); hashCode = prime * hashCode + ((getCheckoutMetadata() == null) ? 0 : getCheckoutMetadata().hashCode()); hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); return hashCode; } @Override public CheckoutBorrowLicenseRequest clone() { return (CheckoutBorrowLicenseRequest) super.clone(); } }