com.amazonaws.services.redshift.model.AuthorizeDataShareRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-redshift Show documentation
/*
* Copyright 2019-2024 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.redshift.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 AuthorizeDataShareRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of the datashare namespace that producers are to authorize sharing for.
*
*/
private String dataShareArn;
/**
*
* The identifier of the data consumer that is authorized to access the datashare. This identifier is an Amazon Web
* Services account ID or a keyword, such as ADX.
*
*/
private String consumerIdentifier;
/**
*
* If set to true, allows write operations for a datashare.
*
*/
private Boolean allowWrites;
/**
*
* The Amazon Resource Name (ARN) of the datashare namespace that producers are to authorize sharing for.
*
*
* @param dataShareArn
* The Amazon Resource Name (ARN) of the datashare namespace that producers are to authorize sharing for.
*/
public void setDataShareArn(String dataShareArn) {
this.dataShareArn = dataShareArn;
}
/**
*
* The Amazon Resource Name (ARN) of the datashare namespace that producers are to authorize sharing for.
*
*
* @return The Amazon Resource Name (ARN) of the datashare namespace that producers are to authorize sharing for.
*/
public String getDataShareArn() {
return this.dataShareArn;
}
/**
*
* The Amazon Resource Name (ARN) of the datashare namespace that producers are to authorize sharing for.
*
*
* @param dataShareArn
* The Amazon Resource Name (ARN) of the datashare namespace that producers are to authorize sharing for.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AuthorizeDataShareRequest withDataShareArn(String dataShareArn) {
setDataShareArn(dataShareArn);
return this;
}
/**
*
* The identifier of the data consumer that is authorized to access the datashare. This identifier is an Amazon Web
* Services account ID or a keyword, such as ADX.
*
*
* @param consumerIdentifier
* The identifier of the data consumer that is authorized to access the datashare. This identifier is an
* Amazon Web Services account ID or a keyword, such as ADX.
*/
public void setConsumerIdentifier(String consumerIdentifier) {
this.consumerIdentifier = consumerIdentifier;
}
/**
*
* The identifier of the data consumer that is authorized to access the datashare. This identifier is an Amazon Web
* Services account ID or a keyword, such as ADX.
*
*
* @return The identifier of the data consumer that is authorized to access the datashare. This identifier is an
* Amazon Web Services account ID or a keyword, such as ADX.
*/
public String getConsumerIdentifier() {
return this.consumerIdentifier;
}
/**
*
* The identifier of the data consumer that is authorized to access the datashare. This identifier is an Amazon Web
* Services account ID or a keyword, such as ADX.
*
*
* @param consumerIdentifier
* The identifier of the data consumer that is authorized to access the datashare. This identifier is an
* Amazon Web Services account ID or a keyword, such as ADX.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AuthorizeDataShareRequest withConsumerIdentifier(String consumerIdentifier) {
setConsumerIdentifier(consumerIdentifier);
return this;
}
/**
*
* If set to true, allows write operations for a datashare.
*
*
* @param allowWrites
* If set to true, allows write operations for a datashare.
*/
public void setAllowWrites(Boolean allowWrites) {
this.allowWrites = allowWrites;
}
/**
*
* If set to true, allows write operations for a datashare.
*
*
* @return If set to true, allows write operations for a datashare.
*/
public Boolean getAllowWrites() {
return this.allowWrites;
}
/**
*
* If set to true, allows write operations for a datashare.
*
*
* @param allowWrites
* If set to true, allows write operations for a datashare.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AuthorizeDataShareRequest withAllowWrites(Boolean allowWrites) {
setAllowWrites(allowWrites);
return this;
}
/**
*
* If set to true, allows write operations for a datashare.
*
*
* @return If set to true, allows write operations for a datashare.
*/
public Boolean isAllowWrites() {
return this.allowWrites;
}
/**
* 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 (getDataShareArn() != null)
sb.append("DataShareArn: ").append(getDataShareArn()).append(",");
if (getConsumerIdentifier() != null)
sb.append("ConsumerIdentifier: ").append(getConsumerIdentifier()).append(",");
if (getAllowWrites() != null)
sb.append("AllowWrites: ").append(getAllowWrites());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AuthorizeDataShareRequest == false)
return false;
AuthorizeDataShareRequest other = (AuthorizeDataShareRequest) obj;
if (other.getDataShareArn() == null ^ this.getDataShareArn() == null)
return false;
if (other.getDataShareArn() != null && other.getDataShareArn().equals(this.getDataShareArn()) == false)
return false;
if (other.getConsumerIdentifier() == null ^ this.getConsumerIdentifier() == null)
return false;
if (other.getConsumerIdentifier() != null && other.getConsumerIdentifier().equals(this.getConsumerIdentifier()) == false)
return false;
if (other.getAllowWrites() == null ^ this.getAllowWrites() == null)
return false;
if (other.getAllowWrites() != null && other.getAllowWrites().equals(this.getAllowWrites()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDataShareArn() == null) ? 0 : getDataShareArn().hashCode());
hashCode = prime * hashCode + ((getConsumerIdentifier() == null) ? 0 : getConsumerIdentifier().hashCode());
hashCode = prime * hashCode + ((getAllowWrites() == null) ? 0 : getAllowWrites().hashCode());
return hashCode;
}
@Override
public AuthorizeDataShareRequest clone() {
return (AuthorizeDataShareRequest) super.clone();
}
}