
com.amazonaws.services.servicecatalog.model.ShareDetails Maven / Gradle / Ivy
Show all versions of aws-java-sdk-servicecatalog Show documentation
/*
* Copyright 2020-2025 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.servicecatalog.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about the portfolio share operation.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ShareDetails implements Serializable, Cloneable, StructuredPojo {
/**
*
* List of accounts for whom the operation succeeded.
*
*/
private java.util.List successfulShares;
/**
*
* List of errors.
*
*/
private java.util.List shareErrors;
/**
*
* List of accounts for whom the operation succeeded.
*
*
* @return List of accounts for whom the operation succeeded.
*/
public java.util.List getSuccessfulShares() {
return successfulShares;
}
/**
*
* List of accounts for whom the operation succeeded.
*
*
* @param successfulShares
* List of accounts for whom the operation succeeded.
*/
public void setSuccessfulShares(java.util.Collection successfulShares) {
if (successfulShares == null) {
this.successfulShares = null;
return;
}
this.successfulShares = new java.util.ArrayList(successfulShares);
}
/**
*
* List of accounts for whom the operation succeeded.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSuccessfulShares(java.util.Collection)} or {@link #withSuccessfulShares(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param successfulShares
* List of accounts for whom the operation succeeded.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ShareDetails withSuccessfulShares(String... successfulShares) {
if (this.successfulShares == null) {
setSuccessfulShares(new java.util.ArrayList(successfulShares.length));
}
for (String ele : successfulShares) {
this.successfulShares.add(ele);
}
return this;
}
/**
*
* List of accounts for whom the operation succeeded.
*
*
* @param successfulShares
* List of accounts for whom the operation succeeded.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ShareDetails withSuccessfulShares(java.util.Collection successfulShares) {
setSuccessfulShares(successfulShares);
return this;
}
/**
*
* List of errors.
*
*
* @return List of errors.
*/
public java.util.List getShareErrors() {
return shareErrors;
}
/**
*
* List of errors.
*
*
* @param shareErrors
* List of errors.
*/
public void setShareErrors(java.util.Collection shareErrors) {
if (shareErrors == null) {
this.shareErrors = null;
return;
}
this.shareErrors = new java.util.ArrayList(shareErrors);
}
/**
*
* List of errors.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setShareErrors(java.util.Collection)} or {@link #withShareErrors(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param shareErrors
* List of errors.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ShareDetails withShareErrors(ShareError... shareErrors) {
if (this.shareErrors == null) {
setShareErrors(new java.util.ArrayList(shareErrors.length));
}
for (ShareError ele : shareErrors) {
this.shareErrors.add(ele);
}
return this;
}
/**
*
* List of errors.
*
*
* @param shareErrors
* List of errors.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ShareDetails withShareErrors(java.util.Collection shareErrors) {
setShareErrors(shareErrors);
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 (getSuccessfulShares() != null)
sb.append("SuccessfulShares: ").append(getSuccessfulShares()).append(",");
if (getShareErrors() != null)
sb.append("ShareErrors: ").append(getShareErrors());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ShareDetails == false)
return false;
ShareDetails other = (ShareDetails) obj;
if (other.getSuccessfulShares() == null ^ this.getSuccessfulShares() == null)
return false;
if (other.getSuccessfulShares() != null && other.getSuccessfulShares().equals(this.getSuccessfulShares()) == false)
return false;
if (other.getShareErrors() == null ^ this.getShareErrors() == null)
return false;
if (other.getShareErrors() != null && other.getShareErrors().equals(this.getShareErrors()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSuccessfulShares() == null) ? 0 : getSuccessfulShares().hashCode());
hashCode = prime * hashCode + ((getShareErrors() == null) ? 0 : getShareErrors().hashCode());
return hashCode;
}
@Override
public ShareDetails clone() {
try {
return (ShareDetails) 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.servicecatalog.model.transform.ShareDetailsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}