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

* Describes the failure of a license operation. *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class LicenseOperationFailure implements Serializable, Cloneable, StructuredPojo { /** *

* Amazon Resource Name (ARN) of the resource. *

*/ private String resourceArn; /** *

* Resource type. *

*/ private String resourceType; /** *

* Error message. *

*/ private String errorMessage; /** *

* Failure time. *

*/ private java.util.Date failureTime; /** *

* Name of the operation. *

*/ private String operationName; /** *

* ID of the Amazon Web Services account that owns the resource. *

*/ private String resourceOwnerId; /** *

* The requester is "License Manager Automated Discovery". *

*/ private String operationRequestedBy; /** *

* Reserved. *

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

* Amazon Resource Name (ARN) of the resource. *

* * @param resourceArn * Amazon Resource Name (ARN) of the resource. */ public void setResourceArn(String resourceArn) { this.resourceArn = resourceArn; } /** *

* Amazon Resource Name (ARN) of the resource. *

* * @return Amazon Resource Name (ARN) of the resource. */ public String getResourceArn() { return this.resourceArn; } /** *

* Amazon Resource Name (ARN) of the resource. *

* * @param resourceArn * Amazon Resource Name (ARN) of the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseOperationFailure withResourceArn(String resourceArn) { setResourceArn(resourceArn); return this; } /** *

* Resource type. *

* * @param resourceType * Resource type. * @see ResourceType */ public void setResourceType(String resourceType) { this.resourceType = resourceType; } /** *

* Resource type. *

* * @return Resource type. * @see ResourceType */ public String getResourceType() { return this.resourceType; } /** *

* Resource type. *

* * @param resourceType * Resource type. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public LicenseOperationFailure withResourceType(String resourceType) { setResourceType(resourceType); return this; } /** *

* Resource type. *

* * @param resourceType * Resource type. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public LicenseOperationFailure withResourceType(ResourceType resourceType) { this.resourceType = resourceType.toString(); return this; } /** *

* Error message. *

* * @param errorMessage * Error message. */ public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } /** *

* Error message. *

* * @return Error message. */ public String getErrorMessage() { return this.errorMessage; } /** *

* Error message. *

* * @param errorMessage * Error message. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseOperationFailure withErrorMessage(String errorMessage) { setErrorMessage(errorMessage); return this; } /** *

* Failure time. *

* * @param failureTime * Failure time. */ public void setFailureTime(java.util.Date failureTime) { this.failureTime = failureTime; } /** *

* Failure time. *

* * @return Failure time. */ public java.util.Date getFailureTime() { return this.failureTime; } /** *

* Failure time. *

* * @param failureTime * Failure time. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseOperationFailure withFailureTime(java.util.Date failureTime) { setFailureTime(failureTime); return this; } /** *

* Name of the operation. *

* * @param operationName * Name of the operation. */ public void setOperationName(String operationName) { this.operationName = operationName; } /** *

* Name of the operation. *

* * @return Name of the operation. */ public String getOperationName() { return this.operationName; } /** *

* Name of the operation. *

* * @param operationName * Name of the operation. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseOperationFailure withOperationName(String operationName) { setOperationName(operationName); return this; } /** *

* ID of the Amazon Web Services account that owns the resource. *

* * @param resourceOwnerId * ID of the Amazon Web Services account that owns the resource. */ public void setResourceOwnerId(String resourceOwnerId) { this.resourceOwnerId = resourceOwnerId; } /** *

* ID of the Amazon Web Services account that owns the resource. *

* * @return ID of the Amazon Web Services account that owns the resource. */ public String getResourceOwnerId() { return this.resourceOwnerId; } /** *

* ID of the Amazon Web Services account that owns the resource. *

* * @param resourceOwnerId * ID of the Amazon Web Services account that owns the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseOperationFailure withResourceOwnerId(String resourceOwnerId) { setResourceOwnerId(resourceOwnerId); return this; } /** *

* The requester is "License Manager Automated Discovery". *

* * @param operationRequestedBy * The requester is "License Manager Automated Discovery". */ public void setOperationRequestedBy(String operationRequestedBy) { this.operationRequestedBy = operationRequestedBy; } /** *

* The requester is "License Manager Automated Discovery". *

* * @return The requester is "License Manager Automated Discovery". */ public String getOperationRequestedBy() { return this.operationRequestedBy; } /** *

* The requester is "License Manager Automated Discovery". *

* * @param operationRequestedBy * The requester is "License Manager Automated Discovery". * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseOperationFailure withOperationRequestedBy(String operationRequestedBy) { setOperationRequestedBy(operationRequestedBy); return this; } /** *

* Reserved. *

* * @return Reserved. */ public java.util.List getMetadataList() { return metadataList; } /** *

* Reserved. *

* * @param metadataList * Reserved. */ public void setMetadataList(java.util.Collection metadataList) { if (metadataList == null) { this.metadataList = null; return; } this.metadataList = new java.util.ArrayList(metadataList); } /** *

* Reserved. *

*

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

* * @param metadataList * Reserved. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseOperationFailure withMetadataList(Metadata... metadataList) { if (this.metadataList == null) { setMetadataList(new java.util.ArrayList(metadataList.length)); } for (Metadata ele : metadataList) { this.metadataList.add(ele); } return this; } /** *

* Reserved. *

* * @param metadataList * Reserved. * @return Returns a reference to this object so that method calls can be chained together. */ public LicenseOperationFailure withMetadataList(java.util.Collection metadataList) { setMetadataList(metadataList); 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 (getResourceArn() != null) sb.append("ResourceArn: ").append(getResourceArn()).append(","); if (getResourceType() != null) sb.append("ResourceType: ").append(getResourceType()).append(","); if (getErrorMessage() != null) sb.append("ErrorMessage: ").append(getErrorMessage()).append(","); if (getFailureTime() != null) sb.append("FailureTime: ").append(getFailureTime()).append(","); if (getOperationName() != null) sb.append("OperationName: ").append(getOperationName()).append(","); if (getResourceOwnerId() != null) sb.append("ResourceOwnerId: ").append(getResourceOwnerId()).append(","); if (getOperationRequestedBy() != null) sb.append("OperationRequestedBy: ").append(getOperationRequestedBy()).append(","); if (getMetadataList() != null) sb.append("MetadataList: ").append(getMetadataList()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof LicenseOperationFailure == false) return false; LicenseOperationFailure other = (LicenseOperationFailure) obj; if (other.getResourceArn() == null ^ this.getResourceArn() == null) return false; if (other.getResourceArn() != null && other.getResourceArn().equals(this.getResourceArn()) == false) return false; if (other.getResourceType() == null ^ this.getResourceType() == null) return false; if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false) return false; if (other.getErrorMessage() == null ^ this.getErrorMessage() == null) return false; if (other.getErrorMessage() != null && other.getErrorMessage().equals(this.getErrorMessage()) == false) return false; if (other.getFailureTime() == null ^ this.getFailureTime() == null) return false; if (other.getFailureTime() != null && other.getFailureTime().equals(this.getFailureTime()) == false) return false; if (other.getOperationName() == null ^ this.getOperationName() == null) return false; if (other.getOperationName() != null && other.getOperationName().equals(this.getOperationName()) == false) return false; if (other.getResourceOwnerId() == null ^ this.getResourceOwnerId() == null) return false; if (other.getResourceOwnerId() != null && other.getResourceOwnerId().equals(this.getResourceOwnerId()) == false) return false; if (other.getOperationRequestedBy() == null ^ this.getOperationRequestedBy() == null) return false; if (other.getOperationRequestedBy() != null && other.getOperationRequestedBy().equals(this.getOperationRequestedBy()) == false) return false; if (other.getMetadataList() == null ^ this.getMetadataList() == null) return false; if (other.getMetadataList() != null && other.getMetadataList().equals(this.getMetadataList()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getResourceArn() == null) ? 0 : getResourceArn().hashCode()); hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode()); hashCode = prime * hashCode + ((getErrorMessage() == null) ? 0 : getErrorMessage().hashCode()); hashCode = prime * hashCode + ((getFailureTime() == null) ? 0 : getFailureTime().hashCode()); hashCode = prime * hashCode + ((getOperationName() == null) ? 0 : getOperationName().hashCode()); hashCode = prime * hashCode + ((getResourceOwnerId() == null) ? 0 : getResourceOwnerId().hashCode()); hashCode = prime * hashCode + ((getOperationRequestedBy() == null) ? 0 : getOperationRequestedBy().hashCode()); hashCode = prime * hashCode + ((getMetadataList() == null) ? 0 : getMetadataList().hashCode()); return hashCode; } @Override public LicenseOperationFailure clone() { try { return (LicenseOperationFailure) 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.LicenseOperationFailureMarshaller.getInstance().marshall(this, protocolMarshaller); } }