
software.amazon.awssdk.services.storagegateway.model.UpdateSmbFileShareRequest Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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.storagegateway.model;
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.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* UpdateSMBFileShareInput
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateSmbFileShareRequest extends StorageGatewayRequest implements
ToCopyableBuilder {
private static final SdkField FILE_SHARE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdateSmbFileShareRequest::fileShareARN)).setter(setter(Builder::fileShareARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FileShareARN").build()).build();
private static final SdkField KMS_ENCRYPTED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(UpdateSmbFileShareRequest::kmsEncrypted)).setter(setter(Builder::kmsEncrypted))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KMSEncrypted").build()).build();
private static final SdkField KMS_KEY_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdateSmbFileShareRequest::kmsKey)).setter(setter(Builder::kmsKey))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KMSKey").build()).build();
private static final SdkField DEFAULT_STORAGE_CLASS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdateSmbFileShareRequest::defaultStorageClass)).setter(setter(Builder::defaultStorageClass))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultStorageClass").build())
.build();
private static final SdkField OBJECT_ACL_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdateSmbFileShareRequest::objectACLAsString)).setter(setter(Builder::objectACL))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ObjectACL").build()).build();
private static final SdkField READ_ONLY_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(UpdateSmbFileShareRequest::readOnly)).setter(setter(Builder::readOnly))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReadOnly").build()).build();
private static final SdkField GUESS_MIME_TYPE_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(UpdateSmbFileShareRequest::guessMIMETypeEnabled)).setter(setter(Builder::guessMIMETypeEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GuessMIMETypeEnabled").build())
.build();
private static final SdkField REQUESTER_PAYS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(UpdateSmbFileShareRequest::requesterPays)).setter(setter(Builder::requesterPays))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RequesterPays").build()).build();
private static final SdkField SMBACL_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(UpdateSmbFileShareRequest::smbaclEnabled)).setter(setter(Builder::smbaclEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SMBACLEnabled").build()).build();
private static final SdkField> ADMIN_USER_LIST_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(UpdateSmbFileShareRequest::adminUserList))
.setter(setter(Builder::adminUserList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AdminUserList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> VALID_USER_LIST_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(UpdateSmbFileShareRequest::validUserList))
.setter(setter(Builder::validUserList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ValidUserList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> INVALID_USER_LIST_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(UpdateSmbFileShareRequest::invalidUserList))
.setter(setter(Builder::invalidUserList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InvalidUserList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FILE_SHARE_ARN_FIELD,
KMS_ENCRYPTED_FIELD, KMS_KEY_FIELD, DEFAULT_STORAGE_CLASS_FIELD, OBJECT_ACL_FIELD, READ_ONLY_FIELD,
GUESS_MIME_TYPE_ENABLED_FIELD, REQUESTER_PAYS_FIELD, SMBACL_ENABLED_FIELD, ADMIN_USER_LIST_FIELD,
VALID_USER_LIST_FIELD, INVALID_USER_LIST_FIELD));
private final String fileShareARN;
private final Boolean kmsEncrypted;
private final String kmsKey;
private final String defaultStorageClass;
private final String objectACL;
private final Boolean readOnly;
private final Boolean guessMIMETypeEnabled;
private final Boolean requesterPays;
private final Boolean smbaclEnabled;
private final List adminUserList;
private final List validUserList;
private final List invalidUserList;
private UpdateSmbFileShareRequest(BuilderImpl builder) {
super(builder);
this.fileShareARN = builder.fileShareARN;
this.kmsEncrypted = builder.kmsEncrypted;
this.kmsKey = builder.kmsKey;
this.defaultStorageClass = builder.defaultStorageClass;
this.objectACL = builder.objectACL;
this.readOnly = builder.readOnly;
this.guessMIMETypeEnabled = builder.guessMIMETypeEnabled;
this.requesterPays = builder.requesterPays;
this.smbaclEnabled = builder.smbaclEnabled;
this.adminUserList = builder.adminUserList;
this.validUserList = builder.validUserList;
this.invalidUserList = builder.invalidUserList;
}
/**
*
* The Amazon Resource Name (ARN) of the SMB file share that you want to update.
*
*
* @return The Amazon Resource Name (ARN) of the SMB file share that you want to update.
*/
public String fileShareARN() {
return fileShareARN;
}
/**
*
* True to use Amazon S3 server side encryption with your own AWS KMS key, or false to use a key managed by Amazon
* S3. Optional.
*
*
* @return True to use Amazon S3 server side encryption with your own AWS KMS key, or false to use a key managed by
* Amazon S3. Optional.
*/
public Boolean kmsEncrypted() {
return kmsEncrypted;
}
/**
*
* The Amazon Resource Name (ARN) of the AWS KMS key used for Amazon S3 server side encryption. This value can only
* be set when KMSEncrypted is true. Optional.
*
*
* @return The Amazon Resource Name (ARN) of the AWS KMS key used for Amazon S3 server side encryption. This value
* can only be set when KMSEncrypted is true. Optional.
*/
public String kmsKey() {
return kmsKey;
}
/**
*
* The default storage class for objects put into an Amazon S3 bucket by the file gateway. Possible values are
* S3_STANDARD
, S3_STANDARD_IA
, or S3_ONEZONE_IA
. If this field is not
* populated, the default value S3_STANDARD
is used. Optional.
*
*
* @return The default storage class for objects put into an Amazon S3 bucket by the file gateway. Possible values
* are S3_STANDARD
, S3_STANDARD_IA
, or S3_ONEZONE_IA
. If this field
* is not populated, the default value S3_STANDARD
is used. Optional.
*/
public String defaultStorageClass() {
return defaultStorageClass;
}
/**
*
* A value that sets the access control list permission for objects in the S3 bucket that a file gateway puts
* objects into. The default value is "private".
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #objectACL} will
* return {@link ObjectACL#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #objectACLAsString}.
*
*
* @return A value that sets the access control list permission for objects in the S3 bucket that a file gateway
* puts objects into. The default value is "private".
* @see ObjectACL
*/
public ObjectACL objectACL() {
return ObjectACL.fromValue(objectACL);
}
/**
*
* A value that sets the access control list permission for objects in the S3 bucket that a file gateway puts
* objects into. The default value is "private".
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #objectACL} will
* return {@link ObjectACL#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #objectACLAsString}.
*
*
* @return A value that sets the access control list permission for objects in the S3 bucket that a file gateway
* puts objects into. The default value is "private".
* @see ObjectACL
*/
public String objectACLAsString() {
return objectACL;
}
/**
*
* A value that sets the write status of a file share. This value is true if the write status is read-only, and
* otherwise false.
*
*
* @return A value that sets the write status of a file share. This value is true if the write status is read-only,
* and otherwise false.
*/
public Boolean readOnly() {
return readOnly;
}
/**
*
* A value that enables guessing of the MIME type for uploaded objects based on file extensions. Set this value to
* true to enable MIME type guessing, and otherwise to false. The default value is true.
*
*
* @return A value that enables guessing of the MIME type for uploaded objects based on file extensions. Set this
* value to true to enable MIME type guessing, and otherwise to false. The default value is true.
*/
public Boolean guessMIMETypeEnabled() {
return guessMIMETypeEnabled;
}
/**
*
* A value that sets who pays the cost of the request and the cost associated with data download from the S3 bucket.
* If this value is set to true, the requester pays the costs. Otherwise the S3 bucket owner pays. However, the S3
* bucket owner always pays the cost of storing data.
*
*
*
* RequesterPays
is a configuration for the S3 bucket that backs the file share, so make sure that the
* configuration on the file share is the same as the S3 bucket configuration.
*
*
*
* @return A value that sets who pays the cost of the request and the cost associated with data download from the S3
* bucket. If this value is set to true, the requester pays the costs. Otherwise the S3 bucket owner pays.
* However, the S3 bucket owner always pays the cost of storing data.
*
* RequesterPays
is a configuration for the S3 bucket that backs the file share, so make sure
* that the configuration on the file share is the same as the S3 bucket configuration.
*
*/
public Boolean requesterPays() {
return requesterPays;
}
/**
*
* Set this value to "true to enable ACL (access control list) on the SMB file share. Set it to "false" to map file
* and directory permissions to the POSIX permissions.
*
*
* For more information, see https://docs.aws.amazon.com/storagegateway/latest/userguide/smb-acl.htmlin the Storage
* Gateway User Guide.
*
*
* @return Set this value to "true to enable ACL (access control list) on the SMB file share. Set it to "false" to
* map file and directory permissions to the POSIX permissions.
*
* For more information, see https://docs.aws.amazon.com/storagegateway/latest/userguide/smb-acl.htmlin the
* Storage Gateway User Guide.
*/
public Boolean smbaclEnabled() {
return smbaclEnabled;
}
/**
*
* A list of users in the Active Directory that have administrator rights to the file share. A group must be
* prefixed with the @ character. For example @group1
. Can only be set if Authentication is set to
* ActiveDirectory
.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return A list of users in the Active Directory that have administrator rights to the file share. A group must be
* prefixed with the @ character. For example @group1
. Can only be set if Authentication is set
* to ActiveDirectory
.
*/
public List adminUserList() {
return adminUserList;
}
/**
*
* A list of users or groups in the Active Directory that are allowed to access the file share. A group must be
* prefixed with the @ character. For example @group1
. Can only be set if Authentication is set to
* ActiveDirectory
.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return A list of users or groups in the Active Directory that are allowed to access the file share. A group must
* be prefixed with the @ character. For example @group1
. Can only be set if Authentication is
* set to ActiveDirectory
.
*/
public List validUserList() {
return validUserList;
}
/**
*
* A list of users or groups in the Active Directory that are not allowed to access the file share. A group must be
* prefixed with the @ character. For example @group1
. Can only be set if Authentication is set to
* ActiveDirectory
.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return A list of users or groups in the Active Directory that are not allowed to access the file share. A group
* must be prefixed with the @ character. For example @group1
. Can only be set if
* Authentication is set to ActiveDirectory
.
*/
public List invalidUserList() {
return invalidUserList;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(fileShareARN());
hashCode = 31 * hashCode + Objects.hashCode(kmsEncrypted());
hashCode = 31 * hashCode + Objects.hashCode(kmsKey());
hashCode = 31 * hashCode + Objects.hashCode(defaultStorageClass());
hashCode = 31 * hashCode + Objects.hashCode(objectACLAsString());
hashCode = 31 * hashCode + Objects.hashCode(readOnly());
hashCode = 31 * hashCode + Objects.hashCode(guessMIMETypeEnabled());
hashCode = 31 * hashCode + Objects.hashCode(requesterPays());
hashCode = 31 * hashCode + Objects.hashCode(smbaclEnabled());
hashCode = 31 * hashCode + Objects.hashCode(adminUserList());
hashCode = 31 * hashCode + Objects.hashCode(validUserList());
hashCode = 31 * hashCode + Objects.hashCode(invalidUserList());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateSmbFileShareRequest)) {
return false;
}
UpdateSmbFileShareRequest other = (UpdateSmbFileShareRequest) obj;
return Objects.equals(fileShareARN(), other.fileShareARN()) && Objects.equals(kmsEncrypted(), other.kmsEncrypted())
&& Objects.equals(kmsKey(), other.kmsKey()) && Objects.equals(defaultStorageClass(), other.defaultStorageClass())
&& Objects.equals(objectACLAsString(), other.objectACLAsString()) && Objects.equals(readOnly(), other.readOnly())
&& Objects.equals(guessMIMETypeEnabled(), other.guessMIMETypeEnabled())
&& Objects.equals(requesterPays(), other.requesterPays())
&& Objects.equals(smbaclEnabled(), other.smbaclEnabled())
&& Objects.equals(adminUserList(), other.adminUserList())
&& Objects.equals(validUserList(), other.validUserList())
&& Objects.equals(invalidUserList(), other.invalidUserList());
}
/**
* 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 String toString() {
return ToString.builder("UpdateSmbFileShareRequest").add("FileShareARN", fileShareARN())
.add("KMSEncrypted", kmsEncrypted()).add("KMSKey", kmsKey()).add("DefaultStorageClass", defaultStorageClass())
.add("ObjectACL", objectACLAsString()).add("ReadOnly", readOnly())
.add("GuessMIMETypeEnabled", guessMIMETypeEnabled()).add("RequesterPays", requesterPays())
.add("SMBACLEnabled", smbaclEnabled()).add("AdminUserList", adminUserList())
.add("ValidUserList", validUserList()).add("InvalidUserList", invalidUserList()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "FileShareARN":
return Optional.ofNullable(clazz.cast(fileShareARN()));
case "KMSEncrypted":
return Optional.ofNullable(clazz.cast(kmsEncrypted()));
case "KMSKey":
return Optional.ofNullable(clazz.cast(kmsKey()));
case "DefaultStorageClass":
return Optional.ofNullable(clazz.cast(defaultStorageClass()));
case "ObjectACL":
return Optional.ofNullable(clazz.cast(objectACLAsString()));
case "ReadOnly":
return Optional.ofNullable(clazz.cast(readOnly()));
case "GuessMIMETypeEnabled":
return Optional.ofNullable(clazz.cast(guessMIMETypeEnabled()));
case "RequesterPays":
return Optional.ofNullable(clazz.cast(requesterPays()));
case "SMBACLEnabled":
return Optional.ofNullable(clazz.cast(smbaclEnabled()));
case "AdminUserList":
return Optional.ofNullable(clazz.cast(adminUserList()));
case "ValidUserList":
return Optional.ofNullable(clazz.cast(validUserList()));
case "InvalidUserList":
return Optional.ofNullable(clazz.cast(invalidUserList()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function