
com.amazonaws.services.ram.model.AssociatedPermission Maven / Gradle / Ivy
/*
* 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.ram.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* An object that describes a managed permission associated with a resource share.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AssociatedPermission implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon Resource Name
* (ARN) of the associated managed permission.
*
*/
private String arn;
/**
*
* The version of the permission currently associated with the resource share.
*
*/
private String permissionVersion;
/**
*
* Indicates whether the associated resource share is using the default version of the permission.
*
*/
private Boolean defaultVersion;
/**
*
* The resource type to which this permission applies.
*
*/
private String resourceType;
/**
*
* The current status of the association between the permission and the resource share. The following are the
* possible values:
*
*
* -
*
* ATTACHABLE
– This permission or version can be associated with resource shares.
*
*
* -
*
* UNATTACHABLE
– This permission or version can't currently be associated with resource shares.
*
*
* -
*
* DELETING
– This permission or version is in the process of being deleted.
*
*
* -
*
* DELETED
– This permission or version is deleted.
*
*
*
*/
private String status;
/**
*
* Indicates what features are available for this resource share. This parameter can have one of the following
* values:
*
*
* -
*
* STANDARD – A resource share that supports all functionality. These resource shares are visible to all
* principals you share the resource share with. You can modify these resource shares in RAM using the console or
* APIs. This resource share might have been created by RAM, or it might have been CREATED_FROM_POLICY and
* then promoted.
*
*
* -
*
* CREATED_FROM_POLICY – The customer manually shared a resource by attaching a resource-based policy. That
* policy did not match any existing managed permissions, so RAM created this customer managed permission
* automatically on the customer's behalf based on the attached policy document. This type of resource share is
* visible only to the Amazon Web Services account that created it. You can't modify it in RAM unless you promote
* it. For more information, see PromoteResourceShareCreatedFromPolicy.
*
*
* -
*
* PROMOTING_TO_STANDARD – This resource share was originally CREATED_FROM_POLICY
, but the
* customer ran the PromoteResourceShareCreatedFromPolicy and that operation is still in progress. This value
* changes to STANDARD
when complete.
*
*
*
*/
private String featureSet;
/**
*
* The date and time when the association between the permission and the resource share was last updated.
*
*/
private java.util.Date lastUpdatedTime;
/**
*
* The Amazon Resource Name
* (ARN) of a resource share associated with this permission.
*
*/
private String resourceShareArn;
/**
*
* The Amazon Resource Name
* (ARN) of the associated managed permission.
*
*
* @param arn
* The Amazon Resource
* Name (ARN) of the associated managed permission.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The Amazon Resource Name
* (ARN) of the associated managed permission.
*
*
* @return The Amazon Resource
* Name (ARN) of the associated managed permission.
*/
public String getArn() {
return this.arn;
}
/**
*
* The Amazon Resource Name
* (ARN) of the associated managed permission.
*
*
* @param arn
* The Amazon Resource
* Name (ARN) of the associated managed permission.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociatedPermission withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The version of the permission currently associated with the resource share.
*
*
* @param permissionVersion
* The version of the permission currently associated with the resource share.
*/
public void setPermissionVersion(String permissionVersion) {
this.permissionVersion = permissionVersion;
}
/**
*
* The version of the permission currently associated with the resource share.
*
*
* @return The version of the permission currently associated with the resource share.
*/
public String getPermissionVersion() {
return this.permissionVersion;
}
/**
*
* The version of the permission currently associated with the resource share.
*
*
* @param permissionVersion
* The version of the permission currently associated with the resource share.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociatedPermission withPermissionVersion(String permissionVersion) {
setPermissionVersion(permissionVersion);
return this;
}
/**
*
* Indicates whether the associated resource share is using the default version of the permission.
*
*
* @param defaultVersion
* Indicates whether the associated resource share is using the default version of the permission.
*/
public void setDefaultVersion(Boolean defaultVersion) {
this.defaultVersion = defaultVersion;
}
/**
*
* Indicates whether the associated resource share is using the default version of the permission.
*
*
* @return Indicates whether the associated resource share is using the default version of the permission.
*/
public Boolean getDefaultVersion() {
return this.defaultVersion;
}
/**
*
* Indicates whether the associated resource share is using the default version of the permission.
*
*
* @param defaultVersion
* Indicates whether the associated resource share is using the default version of the permission.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociatedPermission withDefaultVersion(Boolean defaultVersion) {
setDefaultVersion(defaultVersion);
return this;
}
/**
*
* Indicates whether the associated resource share is using the default version of the permission.
*
*
* @return Indicates whether the associated resource share is using the default version of the permission.
*/
public Boolean isDefaultVersion() {
return this.defaultVersion;
}
/**
*
* The resource type to which this permission applies.
*
*
* @param resourceType
* The resource type to which this permission applies.
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
*
* The resource type to which this permission applies.
*
*
* @return The resource type to which this permission applies.
*/
public String getResourceType() {
return this.resourceType;
}
/**
*
* The resource type to which this permission applies.
*
*
* @param resourceType
* The resource type to which this permission applies.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociatedPermission withResourceType(String resourceType) {
setResourceType(resourceType);
return this;
}
/**
*
* The current status of the association between the permission and the resource share. The following are the
* possible values:
*
*
* -
*
* ATTACHABLE
– This permission or version can be associated with resource shares.
*
*
* -
*
* UNATTACHABLE
– This permission or version can't currently be associated with resource shares.
*
*
* -
*
* DELETING
– This permission or version is in the process of being deleted.
*
*
* -
*
* DELETED
– This permission or version is deleted.
*
*
*
*
* @param status
* The current status of the association between the permission and the resource share. The following are the
* possible values:
*
* -
*
* ATTACHABLE
– This permission or version can be associated with resource shares.
*
*
* -
*
* UNATTACHABLE
– This permission or version can't currently be associated with resource shares.
*
*
* -
*
* DELETING
– This permission or version is in the process of being deleted.
*
*
* -
*
* DELETED
– This permission or version is deleted.
*
*
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The current status of the association between the permission and the resource share. The following are the
* possible values:
*
*
* -
*
* ATTACHABLE
– This permission or version can be associated with resource shares.
*
*
* -
*
* UNATTACHABLE
– This permission or version can't currently be associated with resource shares.
*
*
* -
*
* DELETING
– This permission or version is in the process of being deleted.
*
*
* -
*
* DELETED
– This permission or version is deleted.
*
*
*
*
* @return The current status of the association between the permission and the resource share. The following are
* the possible values:
*
* -
*
* ATTACHABLE
– This permission or version can be associated with resource shares.
*
*
* -
*
* UNATTACHABLE
– This permission or version can't currently be associated with resource
* shares.
*
*
* -
*
* DELETING
– This permission or version is in the process of being deleted.
*
*
* -
*
* DELETED
– This permission or version is deleted.
*
*
*/
public String getStatus() {
return this.status;
}
/**
*
* The current status of the association between the permission and the resource share. The following are the
* possible values:
*
*
* -
*
* ATTACHABLE
– This permission or version can be associated with resource shares.
*
*
* -
*
* UNATTACHABLE
– This permission or version can't currently be associated with resource shares.
*
*
* -
*
* DELETING
– This permission or version is in the process of being deleted.
*
*
* -
*
* DELETED
– This permission or version is deleted.
*
*
*
*
* @param status
* The current status of the association between the permission and the resource share. The following are the
* possible values:
*
* -
*
* ATTACHABLE
– This permission or version can be associated with resource shares.
*
*
* -
*
* UNATTACHABLE
– This permission or version can't currently be associated with resource shares.
*
*
* -
*
* DELETING
– This permission or version is in the process of being deleted.
*
*
* -
*
* DELETED
– This permission or version is deleted.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociatedPermission withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* Indicates what features are available for this resource share. This parameter can have one of the following
* values:
*
*
* -
*
* STANDARD – A resource share that supports all functionality. These resource shares are visible to all
* principals you share the resource share with. You can modify these resource shares in RAM using the console or
* APIs. This resource share might have been created by RAM, or it might have been CREATED_FROM_POLICY and
* then promoted.
*
*
* -
*
* CREATED_FROM_POLICY – The customer manually shared a resource by attaching a resource-based policy. That
* policy did not match any existing managed permissions, so RAM created this customer managed permission
* automatically on the customer's behalf based on the attached policy document. This type of resource share is
* visible only to the Amazon Web Services account that created it. You can't modify it in RAM unless you promote
* it. For more information, see PromoteResourceShareCreatedFromPolicy.
*
*
* -
*
* PROMOTING_TO_STANDARD – This resource share was originally CREATED_FROM_POLICY
, but the
* customer ran the PromoteResourceShareCreatedFromPolicy and that operation is still in progress. This value
* changes to STANDARD
when complete.
*
*
*
*
* @param featureSet
* Indicates what features are available for this resource share. This parameter can have one of the
* following values:
*
* -
*
* STANDARD – A resource share that supports all functionality. These resource shares are visible to
* all principals you share the resource share with. You can modify these resource shares in RAM using the
* console or APIs. This resource share might have been created by RAM, or it might have been
* CREATED_FROM_POLICY and then promoted.
*
*
* -
*
* CREATED_FROM_POLICY – The customer manually shared a resource by attaching a resource-based policy.
* That policy did not match any existing managed permissions, so RAM created this customer managed
* permission automatically on the customer's behalf based on the attached policy document. This type of
* resource share is visible only to the Amazon Web Services account that created it. You can't modify it in
* RAM unless you promote it. For more information, see PromoteResourceShareCreatedFromPolicy.
*
*
* -
*
* PROMOTING_TO_STANDARD – This resource share was originally CREATED_FROM_POLICY
, but
* the customer ran the PromoteResourceShareCreatedFromPolicy and that operation is still in progress.
* This value changes to STANDARD
when complete.
*
*
* @see PermissionFeatureSet
*/
public void setFeatureSet(String featureSet) {
this.featureSet = featureSet;
}
/**
*
* Indicates what features are available for this resource share. This parameter can have one of the following
* values:
*
*
* -
*
* STANDARD – A resource share that supports all functionality. These resource shares are visible to all
* principals you share the resource share with. You can modify these resource shares in RAM using the console or
* APIs. This resource share might have been created by RAM, or it might have been CREATED_FROM_POLICY and
* then promoted.
*
*
* -
*
* CREATED_FROM_POLICY – The customer manually shared a resource by attaching a resource-based policy. That
* policy did not match any existing managed permissions, so RAM created this customer managed permission
* automatically on the customer's behalf based on the attached policy document. This type of resource share is
* visible only to the Amazon Web Services account that created it. You can't modify it in RAM unless you promote
* it. For more information, see PromoteResourceShareCreatedFromPolicy.
*
*
* -
*
* PROMOTING_TO_STANDARD – This resource share was originally CREATED_FROM_POLICY
, but the
* customer ran the PromoteResourceShareCreatedFromPolicy and that operation is still in progress. This value
* changes to STANDARD
when complete.
*
*
*
*
* @return Indicates what features are available for this resource share. This parameter can have one of the
* following values:
*
* -
*
* STANDARD – A resource share that supports all functionality. These resource shares are visible to
* all principals you share the resource share with. You can modify these resource shares in RAM using the
* console or APIs. This resource share might have been created by RAM, or it might have been
* CREATED_FROM_POLICY and then promoted.
*
*
* -
*
* CREATED_FROM_POLICY – The customer manually shared a resource by attaching a resource-based
* policy. That policy did not match any existing managed permissions, so RAM created this customer managed
* permission automatically on the customer's behalf based on the attached policy document. This type of
* resource share is visible only to the Amazon Web Services account that created it. You can't modify it in
* RAM unless you promote it. For more information, see PromoteResourceShareCreatedFromPolicy.
*
*
* -
*
* PROMOTING_TO_STANDARD – This resource share was originally CREATED_FROM_POLICY
, but
* the customer ran the PromoteResourceShareCreatedFromPolicy and that operation is still in
* progress. This value changes to STANDARD
when complete.
*
*
* @see PermissionFeatureSet
*/
public String getFeatureSet() {
return this.featureSet;
}
/**
*
* Indicates what features are available for this resource share. This parameter can have one of the following
* values:
*
*
* -
*
* STANDARD – A resource share that supports all functionality. These resource shares are visible to all
* principals you share the resource share with. You can modify these resource shares in RAM using the console or
* APIs. This resource share might have been created by RAM, or it might have been CREATED_FROM_POLICY and
* then promoted.
*
*
* -
*
* CREATED_FROM_POLICY – The customer manually shared a resource by attaching a resource-based policy. That
* policy did not match any existing managed permissions, so RAM created this customer managed permission
* automatically on the customer's behalf based on the attached policy document. This type of resource share is
* visible only to the Amazon Web Services account that created it. You can't modify it in RAM unless you promote
* it. For more information, see PromoteResourceShareCreatedFromPolicy.
*
*
* -
*
* PROMOTING_TO_STANDARD – This resource share was originally CREATED_FROM_POLICY
, but the
* customer ran the PromoteResourceShareCreatedFromPolicy and that operation is still in progress. This value
* changes to STANDARD
when complete.
*
*
*
*
* @param featureSet
* Indicates what features are available for this resource share. This parameter can have one of the
* following values:
*
* -
*
* STANDARD – A resource share that supports all functionality. These resource shares are visible to
* all principals you share the resource share with. You can modify these resource shares in RAM using the
* console or APIs. This resource share might have been created by RAM, or it might have been
* CREATED_FROM_POLICY and then promoted.
*
*
* -
*
* CREATED_FROM_POLICY – The customer manually shared a resource by attaching a resource-based policy.
* That policy did not match any existing managed permissions, so RAM created this customer managed
* permission automatically on the customer's behalf based on the attached policy document. This type of
* resource share is visible only to the Amazon Web Services account that created it. You can't modify it in
* RAM unless you promote it. For more information, see PromoteResourceShareCreatedFromPolicy.
*
*
* -
*
* PROMOTING_TO_STANDARD – This resource share was originally CREATED_FROM_POLICY
, but
* the customer ran the PromoteResourceShareCreatedFromPolicy and that operation is still in progress.
* This value changes to STANDARD
when complete.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see PermissionFeatureSet
*/
public AssociatedPermission withFeatureSet(String featureSet) {
setFeatureSet(featureSet);
return this;
}
/**
*
* Indicates what features are available for this resource share. This parameter can have one of the following
* values:
*
*
* -
*
* STANDARD – A resource share that supports all functionality. These resource shares are visible to all
* principals you share the resource share with. You can modify these resource shares in RAM using the console or
* APIs. This resource share might have been created by RAM, or it might have been CREATED_FROM_POLICY and
* then promoted.
*
*
* -
*
* CREATED_FROM_POLICY – The customer manually shared a resource by attaching a resource-based policy. That
* policy did not match any existing managed permissions, so RAM created this customer managed permission
* automatically on the customer's behalf based on the attached policy document. This type of resource share is
* visible only to the Amazon Web Services account that created it. You can't modify it in RAM unless you promote
* it. For more information, see PromoteResourceShareCreatedFromPolicy.
*
*
* -
*
* PROMOTING_TO_STANDARD – This resource share was originally CREATED_FROM_POLICY
, but the
* customer ran the PromoteResourceShareCreatedFromPolicy and that operation is still in progress. This value
* changes to STANDARD
when complete.
*
*
*
*
* @param featureSet
* Indicates what features are available for this resource share. This parameter can have one of the
* following values:
*
* -
*
* STANDARD – A resource share that supports all functionality. These resource shares are visible to
* all principals you share the resource share with. You can modify these resource shares in RAM using the
* console or APIs. This resource share might have been created by RAM, or it might have been
* CREATED_FROM_POLICY and then promoted.
*
*
* -
*
* CREATED_FROM_POLICY – The customer manually shared a resource by attaching a resource-based policy.
* That policy did not match any existing managed permissions, so RAM created this customer managed
* permission automatically on the customer's behalf based on the attached policy document. This type of
* resource share is visible only to the Amazon Web Services account that created it. You can't modify it in
* RAM unless you promote it. For more information, see PromoteResourceShareCreatedFromPolicy.
*
*
* -
*
* PROMOTING_TO_STANDARD – This resource share was originally CREATED_FROM_POLICY
, but
* the customer ran the PromoteResourceShareCreatedFromPolicy and that operation is still in progress.
* This value changes to STANDARD
when complete.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see PermissionFeatureSet
*/
public AssociatedPermission withFeatureSet(PermissionFeatureSet featureSet) {
this.featureSet = featureSet.toString();
return this;
}
/**
*
* The date and time when the association between the permission and the resource share was last updated.
*
*
* @param lastUpdatedTime
* The date and time when the association between the permission and the resource share was last updated.
*/
public void setLastUpdatedTime(java.util.Date lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
}
/**
*
* The date and time when the association between the permission and the resource share was last updated.
*
*
* @return The date and time when the association between the permission and the resource share was last updated.
*/
public java.util.Date getLastUpdatedTime() {
return this.lastUpdatedTime;
}
/**
*
* The date and time when the association between the permission and the resource share was last updated.
*
*
* @param lastUpdatedTime
* The date and time when the association between the permission and the resource share was last updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociatedPermission withLastUpdatedTime(java.util.Date lastUpdatedTime) {
setLastUpdatedTime(lastUpdatedTime);
return this;
}
/**
*
* The Amazon Resource Name
* (ARN) of a resource share associated with this permission.
*
*
* @param resourceShareArn
* The Amazon Resource
* Name (ARN) of a resource share associated with this permission.
*/
public void setResourceShareArn(String resourceShareArn) {
this.resourceShareArn = resourceShareArn;
}
/**
*
* The Amazon Resource Name
* (ARN) of a resource share associated with this permission.
*
*
* @return The Amazon Resource
* Name (ARN) of a resource share associated with this permission.
*/
public String getResourceShareArn() {
return this.resourceShareArn;
}
/**
*
* The Amazon Resource Name
* (ARN) of a resource share associated with this permission.
*
*
* @param resourceShareArn
* The Amazon Resource
* Name (ARN) of a resource share associated with this permission.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociatedPermission withResourceShareArn(String resourceShareArn) {
setResourceShareArn(resourceShareArn);
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 (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getPermissionVersion() != null)
sb.append("PermissionVersion: ").append(getPermissionVersion()).append(",");
if (getDefaultVersion() != null)
sb.append("DefaultVersion: ").append(getDefaultVersion()).append(",");
if (getResourceType() != null)
sb.append("ResourceType: ").append(getResourceType()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getFeatureSet() != null)
sb.append("FeatureSet: ").append(getFeatureSet()).append(",");
if (getLastUpdatedTime() != null)
sb.append("LastUpdatedTime: ").append(getLastUpdatedTime()).append(",");
if (getResourceShareArn() != null)
sb.append("ResourceShareArn: ").append(getResourceShareArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AssociatedPermission == false)
return false;
AssociatedPermission other = (AssociatedPermission) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getPermissionVersion() == null ^ this.getPermissionVersion() == null)
return false;
if (other.getPermissionVersion() != null && other.getPermissionVersion().equals(this.getPermissionVersion()) == false)
return false;
if (other.getDefaultVersion() == null ^ this.getDefaultVersion() == null)
return false;
if (other.getDefaultVersion() != null && other.getDefaultVersion().equals(this.getDefaultVersion()) == 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.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getFeatureSet() == null ^ this.getFeatureSet() == null)
return false;
if (other.getFeatureSet() != null && other.getFeatureSet().equals(this.getFeatureSet()) == false)
return false;
if (other.getLastUpdatedTime() == null ^ this.getLastUpdatedTime() == null)
return false;
if (other.getLastUpdatedTime() != null && other.getLastUpdatedTime().equals(this.getLastUpdatedTime()) == false)
return false;
if (other.getResourceShareArn() == null ^ this.getResourceShareArn() == null)
return false;
if (other.getResourceShareArn() != null && other.getResourceShareArn().equals(this.getResourceShareArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getPermissionVersion() == null) ? 0 : getPermissionVersion().hashCode());
hashCode = prime * hashCode + ((getDefaultVersion() == null) ? 0 : getDefaultVersion().hashCode());
hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getFeatureSet() == null) ? 0 : getFeatureSet().hashCode());
hashCode = prime * hashCode + ((getLastUpdatedTime() == null) ? 0 : getLastUpdatedTime().hashCode());
hashCode = prime * hashCode + ((getResourceShareArn() == null) ? 0 : getResourceShareArn().hashCode());
return hashCode;
}
@Override
public AssociatedPermission clone() {
try {
return (AssociatedPermission) 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.ram.model.transform.AssociatedPermissionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}