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

software.amazon.awssdk.services.ram.model.ResourceSharePermissionDetail Maven / Gradle / Ivy

Go to download

The AWS Java SDK for RAM module holds the client classes that are used for communicating with RAM.

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright 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 software.amazon.awssdk.services.ram.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Information about an RAM permission. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ResourceSharePermissionDetail implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn") .getter(getter(ResourceSharePermissionDetail::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("version") .getter(getter(ResourceSharePermissionDetail::version)).setter(setter(Builder::version)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("version").build()).build(); private static final SdkField DEFAULT_VERSION_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("defaultVersion").getter(getter(ResourceSharePermissionDetail::defaultVersion)) .setter(setter(Builder::defaultVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("defaultVersion").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name") .getter(getter(ResourceSharePermissionDetail::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final SdkField RESOURCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("resourceType").getter(getter(ResourceSharePermissionDetail::resourceType)) .setter(setter(Builder::resourceType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resourceType").build()).build(); private static final SdkField PERMISSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("permission").getter(getter(ResourceSharePermissionDetail::permission)) .setter(setter(Builder::permission)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("permission").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("creationTime").getter(getter(ResourceSharePermissionDetail::creationTime)) .setter(setter(Builder::creationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationTime").build()).build(); private static final SdkField LAST_UPDATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("lastUpdatedTime").getter(getter(ResourceSharePermissionDetail::lastUpdatedTime)) .setter(setter(Builder::lastUpdatedTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastUpdatedTime").build()).build(); private static final SdkField IS_RESOURCE_TYPE_DEFAULT_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("isResourceTypeDefault").getter(getter(ResourceSharePermissionDetail::isResourceTypeDefault)) .setter(setter(Builder::isResourceTypeDefault)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("isResourceTypeDefault").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, VERSION_FIELD, DEFAULT_VERSION_FIELD, NAME_FIELD, RESOURCE_TYPE_FIELD, PERMISSION_FIELD, CREATION_TIME_FIELD, LAST_UPDATED_TIME_FIELD, IS_RESOURCE_TYPE_DEFAULT_FIELD)); private static final long serialVersionUID = 1L; private final String arn; private final String version; private final Boolean defaultVersion; private final String name; private final String resourceType; private final String permission; private final Instant creationTime; private final Instant lastUpdatedTime; private final Boolean isResourceTypeDefault; private ResourceSharePermissionDetail(BuilderImpl builder) { this.arn = builder.arn; this.version = builder.version; this.defaultVersion = builder.defaultVersion; this.name = builder.name; this.resourceType = builder.resourceType; this.permission = builder.permission; this.creationTime = builder.creationTime; this.lastUpdatedTime = builder.lastUpdatedTime; this.isResourceTypeDefault = builder.isResourceTypeDefault; } /** *

* The Amazon Resoure Name * (ARN) of this RAM permission. *

* * @return The Amazon Resoure * Name (ARN) of this RAM permission. */ public final String arn() { return arn; } /** *

* The version of the permission represented in this structure. *

* * @return The version of the permission represented in this structure. */ public final String version() { return version; } /** *

* Specifies whether the version of the permission represented in this structure is the default version for this * permission. *

* * @return Specifies whether the version of the permission represented in this structure is the default version for * this permission. */ public final Boolean defaultVersion() { return defaultVersion; } /** *

* The name of this permission. *

* * @return The name of this permission. */ public final String name() { return name; } /** *

* The resource type to which this permission applies. *

* * @return The resource type to which this permission applies. */ public final String resourceType() { return resourceType; } /** *

* The permission's effect and actions in JSON format. The effect indicates whether the specified * actions are allowed or denied. The actions list the operations to which the principal is granted or * denied access. *

* * @return The permission's effect and actions in JSON format. The effect indicates whether the * specified actions are allowed or denied. The actions list the operations to which the * principal is granted or denied access. */ public final String permission() { return permission; } /** *

* The date and time when the permission was created. *

* * @return The date and time when the permission was created. */ public final Instant creationTime() { return creationTime; } /** *

* The date and time when the permission was last updated. *

* * @return The date and time when the permission was last updated. */ public final Instant lastUpdatedTime() { return lastUpdatedTime; } /** *

* Specifies whether the version of the permission represented in this structure is the default version for all * resources of this resource type. *

* * @return Specifies whether the version of the permission represented in this structure is the default version for * all resources of this resource type. */ public final Boolean isResourceTypeDefault() { return isResourceTypeDefault; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(defaultVersion()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(resourceType()); hashCode = 31 * hashCode + Objects.hashCode(permission()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedTime()); hashCode = 31 * hashCode + Objects.hashCode(isResourceTypeDefault()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ResourceSharePermissionDetail)) { return false; } ResourceSharePermissionDetail other = (ResourceSharePermissionDetail) obj; return Objects.equals(arn(), other.arn()) && Objects.equals(version(), other.version()) && Objects.equals(defaultVersion(), other.defaultVersion()) && Objects.equals(name(), other.name()) && Objects.equals(resourceType(), other.resourceType()) && Objects.equals(permission(), other.permission()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(lastUpdatedTime(), other.lastUpdatedTime()) && Objects.equals(isResourceTypeDefault(), other.isResourceTypeDefault()); } /** * 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. */ @Override public final String toString() { return ToString.builder("ResourceSharePermissionDetail").add("Arn", arn()).add("Version", version()) .add("DefaultVersion", defaultVersion()).add("Name", name()).add("ResourceType", resourceType()) .add("Permission", permission()).add("CreationTime", creationTime()).add("LastUpdatedTime", lastUpdatedTime()) .add("IsResourceTypeDefault", isResourceTypeDefault()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "arn": return Optional.ofNullable(clazz.cast(arn())); case "version": return Optional.ofNullable(clazz.cast(version())); case "defaultVersion": return Optional.ofNullable(clazz.cast(defaultVersion())); case "name": return Optional.ofNullable(clazz.cast(name())); case "resourceType": return Optional.ofNullable(clazz.cast(resourceType())); case "permission": return Optional.ofNullable(clazz.cast(permission())); case "creationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "lastUpdatedTime": return Optional.ofNullable(clazz.cast(lastUpdatedTime())); case "isResourceTypeDefault": return Optional.ofNullable(clazz.cast(isResourceTypeDefault())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ResourceSharePermissionDetail) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The Amazon Resoure Name * (ARN) of this RAM permission. *

* * @param arn * The Amazon * Resoure Name (ARN) of this RAM permission. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* The version of the permission represented in this structure. *

* * @param version * The version of the permission represented in this structure. * @return Returns a reference to this object so that method calls can be chained together. */ Builder version(String version); /** *

* Specifies whether the version of the permission represented in this structure is the default version for this * permission. *

* * @param defaultVersion * Specifies whether the version of the permission represented in this structure is the default version * for this permission. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultVersion(Boolean defaultVersion); /** *

* The name of this permission. *

* * @param name * The name of this permission. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* 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. */ Builder resourceType(String resourceType); /** *

* The permission's effect and actions in JSON format. The effect indicates whether the specified * actions are allowed or denied. The actions list the operations to which the principal is granted * or denied access. *

* * @param permission * The permission's effect and actions in JSON format. The effect indicates whether the * specified actions are allowed or denied. The actions list the operations to which the * principal is granted or denied access. * @return Returns a reference to this object so that method calls can be chained together. */ Builder permission(String permission); /** *

* The date and time when the permission was created. *

* * @param creationTime * The date and time when the permission was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

* The date and time when the permission was last updated. *

* * @param lastUpdatedTime * The date and time when the permission was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastUpdatedTime(Instant lastUpdatedTime); /** *

* Specifies whether the version of the permission represented in this structure is the default version for all * resources of this resource type. *

* * @param isResourceTypeDefault * Specifies whether the version of the permission represented in this structure is the default version * for all resources of this resource type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isResourceTypeDefault(Boolean isResourceTypeDefault); } static final class BuilderImpl implements Builder { private String arn; private String version; private Boolean defaultVersion; private String name; private String resourceType; private String permission; private Instant creationTime; private Instant lastUpdatedTime; private Boolean isResourceTypeDefault; private BuilderImpl() { } private BuilderImpl(ResourceSharePermissionDetail model) { arn(model.arn); version(model.version); defaultVersion(model.defaultVersion); name(model.name); resourceType(model.resourceType); permission(model.permission); creationTime(model.creationTime); lastUpdatedTime(model.lastUpdatedTime); isResourceTypeDefault(model.isResourceTypeDefault); } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getVersion() { return version; } public final void setVersion(String version) { this.version = version; } @Override public final Builder version(String version) { this.version = version; return this; } public final Boolean getDefaultVersion() { return defaultVersion; } public final void setDefaultVersion(Boolean defaultVersion) { this.defaultVersion = defaultVersion; } @Override public final Builder defaultVersion(Boolean defaultVersion) { this.defaultVersion = defaultVersion; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getResourceType() { return resourceType; } public final void setResourceType(String resourceType) { this.resourceType = resourceType; } @Override public final Builder resourceType(String resourceType) { this.resourceType = resourceType; return this; } public final String getPermission() { return permission; } public final void setPermission(String permission) { this.permission = permission; } @Override public final Builder permission(String permission) { this.permission = permission; return this; } public final Instant getCreationTime() { return creationTime; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final Instant getLastUpdatedTime() { return lastUpdatedTime; } public final void setLastUpdatedTime(Instant lastUpdatedTime) { this.lastUpdatedTime = lastUpdatedTime; } @Override public final Builder lastUpdatedTime(Instant lastUpdatedTime) { this.lastUpdatedTime = lastUpdatedTime; return this; } public final Boolean getIsResourceTypeDefault() { return isResourceTypeDefault; } public final void setIsResourceTypeDefault(Boolean isResourceTypeDefault) { this.isResourceTypeDefault = isResourceTypeDefault; } @Override public final Builder isResourceTypeDefault(Boolean isResourceTypeDefault) { this.isResourceTypeDefault = isResourceTypeDefault; return this; } @Override public ResourceSharePermissionDetail build() { return new ResourceSharePermissionDetail(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy