All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.simplesystemsmanagement.model.ModifyDocumentPermissionRequest Maven / Gradle / Ivy

/*
 * Copyright 2011-2016 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.simplesystemsmanagement.model;

import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;

/**
 * 
 */
public class ModifyDocumentPermissionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     * 

* The name of the document that you want to share. *

*/ private String name; /** *

* The permission type for the document. The permission type can be Share. *

*/ private String permissionType; /** *

* The AWS user accounts that should have access to the document. The account IDs can either be a group of account * IDs or All. *

*/ private com.amazonaws.internal.SdkInternalList accountIdsToAdd; /** *

* The AWS user accounts that should no longer have access to the document. The AWS user account can either be a * group of account IDs or All. This action has a higher priority than AccountIdsToAdd. If you specify * an account ID to add and the same ID to remove, the system removes access to the document. *

*/ private com.amazonaws.internal.SdkInternalList accountIdsToRemove; /** *

* The name of the document that you want to share. *

* * @param name * The name of the document that you want to share. */ public void setName(String name) { this.name = name; } /** *

* The name of the document that you want to share. *

* * @return The name of the document that you want to share. */ public String getName() { return this.name; } /** *

* The name of the document that you want to share. *

* * @param name * The name of the document that you want to share. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyDocumentPermissionRequest withName(String name) { setName(name); return this; } /** *

* The permission type for the document. The permission type can be Share. *

* * @param permissionType * The permission type for the document. The permission type can be Share. * @see DocumentPermissionType */ public void setPermissionType(String permissionType) { this.permissionType = permissionType; } /** *

* The permission type for the document. The permission type can be Share. *

* * @return The permission type for the document. The permission type can be Share. * @see DocumentPermissionType */ public String getPermissionType() { return this.permissionType; } /** *

* The permission type for the document. The permission type can be Share. *

* * @param permissionType * The permission type for the document. The permission type can be Share. * @return Returns a reference to this object so that method calls can be chained together. * @see DocumentPermissionType */ public ModifyDocumentPermissionRequest withPermissionType(String permissionType) { setPermissionType(permissionType); return this; } /** *

* The permission type for the document. The permission type can be Share. *

* * @param permissionType * The permission type for the document. The permission type can be Share. * @see DocumentPermissionType */ public void setPermissionType(DocumentPermissionType permissionType) { this.permissionType = permissionType.toString(); } /** *

* The permission type for the document. The permission type can be Share. *

* * @param permissionType * The permission type for the document. The permission type can be Share. * @return Returns a reference to this object so that method calls can be chained together. * @see DocumentPermissionType */ public ModifyDocumentPermissionRequest withPermissionType(DocumentPermissionType permissionType) { setPermissionType(permissionType); return this; } /** *

* The AWS user accounts that should have access to the document. The account IDs can either be a group of account * IDs or All. *

* * @return The AWS user accounts that should have access to the document. The account IDs can either be a group of * account IDs or All. */ public java.util.List getAccountIdsToAdd() { if (accountIdsToAdd == null) { accountIdsToAdd = new com.amazonaws.internal.SdkInternalList(); } return accountIdsToAdd; } /** *

* The AWS user accounts that should have access to the document. The account IDs can either be a group of account * IDs or All. *

* * @param accountIdsToAdd * The AWS user accounts that should have access to the document. The account IDs can either be a group of * account IDs or All. */ public void setAccountIdsToAdd(java.util.Collection accountIdsToAdd) { if (accountIdsToAdd == null) { this.accountIdsToAdd = null; return; } this.accountIdsToAdd = new com.amazonaws.internal.SdkInternalList(accountIdsToAdd); } /** *

* The AWS user accounts that should have access to the document. The account IDs can either be a group of account * IDs or All. *

*

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

* * @param accountIdsToAdd * The AWS user accounts that should have access to the document. The account IDs can either be a group of * account IDs or All. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyDocumentPermissionRequest withAccountIdsToAdd(String... accountIdsToAdd) { if (this.accountIdsToAdd == null) { setAccountIdsToAdd(new com.amazonaws.internal.SdkInternalList(accountIdsToAdd.length)); } for (String ele : accountIdsToAdd) { this.accountIdsToAdd.add(ele); } return this; } /** *

* The AWS user accounts that should have access to the document. The account IDs can either be a group of account * IDs or All. *

* * @param accountIdsToAdd * The AWS user accounts that should have access to the document. The account IDs can either be a group of * account IDs or All. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyDocumentPermissionRequest withAccountIdsToAdd(java.util.Collection accountIdsToAdd) { setAccountIdsToAdd(accountIdsToAdd); return this; } /** *

* The AWS user accounts that should no longer have access to the document. The AWS user account can either be a * group of account IDs or All. This action has a higher priority than AccountIdsToAdd. If you specify * an account ID to add and the same ID to remove, the system removes access to the document. *

* * @return The AWS user accounts that should no longer have access to the document. The AWS user account can either * be a group of account IDs or All. This action has a higher priority than AccountIdsToAdd. * If you specify an account ID to add and the same ID to remove, the system removes access to the document. */ public java.util.List getAccountIdsToRemove() { if (accountIdsToRemove == null) { accountIdsToRemove = new com.amazonaws.internal.SdkInternalList(); } return accountIdsToRemove; } /** *

* The AWS user accounts that should no longer have access to the document. The AWS user account can either be a * group of account IDs or All. This action has a higher priority than AccountIdsToAdd. If you specify * an account ID to add and the same ID to remove, the system removes access to the document. *

* * @param accountIdsToRemove * The AWS user accounts that should no longer have access to the document. The AWS user account can either * be a group of account IDs or All. This action has a higher priority than AccountIdsToAdd. If * you specify an account ID to add and the same ID to remove, the system removes access to the document. */ public void setAccountIdsToRemove(java.util.Collection accountIdsToRemove) { if (accountIdsToRemove == null) { this.accountIdsToRemove = null; return; } this.accountIdsToRemove = new com.amazonaws.internal.SdkInternalList(accountIdsToRemove); } /** *

* The AWS user accounts that should no longer have access to the document. The AWS user account can either be a * group of account IDs or All. This action has a higher priority than AccountIdsToAdd. If you specify * an account ID to add and the same ID to remove, the system removes access to the document. *

*

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

* * @param accountIdsToRemove * The AWS user accounts that should no longer have access to the document. The AWS user account can either * be a group of account IDs or All. This action has a higher priority than AccountIdsToAdd. If * you specify an account ID to add and the same ID to remove, the system removes access to the document. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyDocumentPermissionRequest withAccountIdsToRemove(String... accountIdsToRemove) { if (this.accountIdsToRemove == null) { setAccountIdsToRemove(new com.amazonaws.internal.SdkInternalList(accountIdsToRemove.length)); } for (String ele : accountIdsToRemove) { this.accountIdsToRemove.add(ele); } return this; } /** *

* The AWS user accounts that should no longer have access to the document. The AWS user account can either be a * group of account IDs or All. This action has a higher priority than AccountIdsToAdd. If you specify * an account ID to add and the same ID to remove, the system removes access to the document. *

* * @param accountIdsToRemove * The AWS user accounts that should no longer have access to the document. The AWS user account can either * be a group of account IDs or All. This action has a higher priority than AccountIdsToAdd. If * you specify an account ID to add and the same ID to remove, the system removes access to the document. * @return Returns a reference to this object so that method calls can be chained together. */ public ModifyDocumentPermissionRequest withAccountIdsToRemove(java.util.Collection accountIdsToRemove) { setAccountIdsToRemove(accountIdsToRemove); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: " + getName() + ","); if (getPermissionType() != null) sb.append("PermissionType: " + getPermissionType() + ","); if (getAccountIdsToAdd() != null) sb.append("AccountIdsToAdd: " + getAccountIdsToAdd() + ","); if (getAccountIdsToRemove() != null) sb.append("AccountIdsToRemove: " + getAccountIdsToRemove()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ModifyDocumentPermissionRequest == false) return false; ModifyDocumentPermissionRequest other = (ModifyDocumentPermissionRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getPermissionType() == null ^ this.getPermissionType() == null) return false; if (other.getPermissionType() != null && other.getPermissionType().equals(this.getPermissionType()) == false) return false; if (other.getAccountIdsToAdd() == null ^ this.getAccountIdsToAdd() == null) return false; if (other.getAccountIdsToAdd() != null && other.getAccountIdsToAdd().equals(this.getAccountIdsToAdd()) == false) return false; if (other.getAccountIdsToRemove() == null ^ this.getAccountIdsToRemove() == null) return false; if (other.getAccountIdsToRemove() != null && other.getAccountIdsToRemove().equals(this.getAccountIdsToRemove()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getPermissionType() == null) ? 0 : getPermissionType().hashCode()); hashCode = prime * hashCode + ((getAccountIdsToAdd() == null) ? 0 : getAccountIdsToAdd().hashCode()); hashCode = prime * hashCode + ((getAccountIdsToRemove() == null) ? 0 : getAccountIdsToRemove().hashCode()); return hashCode; } @Override public ModifyDocumentPermissionRequest clone() { return (ModifyDocumentPermissionRequest) super.clone(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy