com.amazonaws.services.s3control.model.PutAccessGrantsInstanceResourcePolicyRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-s3control 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.s3control.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 PutAccessGrantsInstanceResourcePolicyRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The ID of the Amazon Web Services account that is making this request.
*
*/
private String accountId;
/**
*
* The resource policy of the S3 Access Grants instance that you are updating.
*
*/
private String policy;
/**
*
* The Organization of the resource policy of the S3 Access Grants instance.
*
*/
private String organization;
/**
*
* The ID of the Amazon Web Services account that is making this request.
*
*
* @param accountId
* The ID of the Amazon Web Services account that is making this request.
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
*
* The ID of the Amazon Web Services account that is making this request.
*
*
* @return The ID of the Amazon Web Services account that is making this request.
*/
public String getAccountId() {
return this.accountId;
}
/**
*
* The ID of the Amazon Web Services account that is making this request.
*
*
* @param accountId
* The ID of the Amazon Web Services account that is making this request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutAccessGrantsInstanceResourcePolicyRequest withAccountId(String accountId) {
setAccountId(accountId);
return this;
}
/**
*
* The resource policy of the S3 Access Grants instance that you are updating.
*
*
* @param policy
* The resource policy of the S3 Access Grants instance that you are updating.
*/
public void setPolicy(String policy) {
this.policy = policy;
}
/**
*
* The resource policy of the S3 Access Grants instance that you are updating.
*
*
* @return The resource policy of the S3 Access Grants instance that you are updating.
*/
public String getPolicy() {
return this.policy;
}
/**
*
* The resource policy of the S3 Access Grants instance that you are updating.
*
*
* @param policy
* The resource policy of the S3 Access Grants instance that you are updating.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutAccessGrantsInstanceResourcePolicyRequest withPolicy(String policy) {
setPolicy(policy);
return this;
}
/**
*
* The Organization of the resource policy of the S3 Access Grants instance.
*
*
* @param organization
* The Organization of the resource policy of the S3 Access Grants instance.
*/
public void setOrganization(String organization) {
this.organization = organization;
}
/**
*
* The Organization of the resource policy of the S3 Access Grants instance.
*
*
* @return The Organization of the resource policy of the S3 Access Grants instance.
*/
public String getOrganization() {
return this.organization;
}
/**
*
* The Organization of the resource policy of the S3 Access Grants instance.
*
*
* @param organization
* The Organization of the resource policy of the S3 Access Grants instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutAccessGrantsInstanceResourcePolicyRequest withOrganization(String organization) {
setOrganization(organization);
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 (getAccountId() != null)
sb.append("AccountId: ").append(getAccountId()).append(",");
if (getPolicy() != null)
sb.append("Policy: ").append(getPolicy()).append(",");
if (getOrganization() != null)
sb.append("Organization: ").append(getOrganization());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PutAccessGrantsInstanceResourcePolicyRequest == false)
return false;
PutAccessGrantsInstanceResourcePolicyRequest other = (PutAccessGrantsInstanceResourcePolicyRequest) obj;
if (other.getAccountId() == null ^ this.getAccountId() == null)
return false;
if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false)
return false;
if (other.getPolicy() == null ^ this.getPolicy() == null)
return false;
if (other.getPolicy() != null && other.getPolicy().equals(this.getPolicy()) == false)
return false;
if (other.getOrganization() == null ^ this.getOrganization() == null)
return false;
if (other.getOrganization() != null && other.getOrganization().equals(this.getOrganization()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
hashCode = prime * hashCode + ((getPolicy() == null) ? 0 : getPolicy().hashCode());
hashCode = prime * hashCode + ((getOrganization() == null) ? 0 : getOrganization().hashCode());
return hashCode;
}
@Override
public PutAccessGrantsInstanceResourcePolicyRequest clone() {
return (PutAccessGrantsInstanceResourcePolicyRequest) super.clone();
}
}