software.amazon.awssdk.services.s3control.model.Include Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of s3control Show documentation
Show all versions of s3control Show documentation
The AWS Java SDK for Amazon S3 Control module holds the client classes that are used for communicating with
Amazon Simple Storage Service Control Plane
/*
* 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.s3control.model;
import java.beans.Transient;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* A container for what Amazon S3 Storage Lens configuration includes.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Include implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField> BUCKETS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Buckets")
.getter(getter(Include::buckets))
.setter(setter(Builder::buckets))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Buckets")
.unmarshallLocationName("Buckets").build(),
ListTrait
.builder()
.memberLocationName("Arn")
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("Arn").unmarshallLocationName("Arn").build()).build()).build())
.build();
private static final SdkField> REGIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Regions")
.getter(getter(Include::regions))
.setter(setter(Builder::regions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Regions")
.unmarshallLocationName("Regions").build(),
ListTrait
.builder()
.memberLocationName("Region")
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("Region").unmarshallLocationName("Region").build()).build())
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BUCKETS_FIELD, REGIONS_FIELD));
private static final long serialVersionUID = 1L;
private final List buckets;
private final List regions;
private Include(BuilderImpl builder) {
this.buckets = builder.buckets;
this.regions = builder.regions;
}
/**
* Returns true if the Buckets property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasBuckets() {
return buckets != null && !(buckets instanceof SdkAutoConstructList);
}
/**
*
* A container for the S3 Storage Lens bucket includes.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasBuckets()} to see if a value was sent in this field.
*
*
* @return A container for the S3 Storage Lens bucket includes.
*/
public final List buckets() {
return buckets;
}
/**
* Returns true if the Regions property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasRegions() {
return regions != null && !(regions instanceof SdkAutoConstructList);
}
/**
*
* A container for the S3 Storage Lens Region includes.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasRegions()} to see if a value was sent in this field.
*
*
* @return A container for the S3 Storage Lens Region includes.
*/
public final List regions() {
return regions;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(hasBuckets() ? buckets() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasRegions() ? regions() : null);
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 Include)) {
return false;
}
Include other = (Include) obj;
return hasBuckets() == other.hasBuckets() && Objects.equals(buckets(), other.buckets())
&& hasRegions() == other.hasRegions() && Objects.equals(regions(), other.regions());
}
/**
* 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("Include").add("Buckets", hasBuckets() ? buckets() : null)
.add("Regions", hasRegions() ? regions() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Buckets":
return Optional.ofNullable(clazz.cast(buckets()));
case "Regions":
return Optional.ofNullable(clazz.cast(regions()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy