
software.amazon.awssdk.services.alexaforbusiness.model.CreateProfileRequest Maven / Gradle / Ivy
/*
* 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.alexaforbusiness.model;
import java.beans.Transient;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.DefaultValueTrait;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateProfileRequest extends AlexaForBusinessRequest implements
ToCopyableBuilder {
private static final SdkField PROFILE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProfileName").getter(getter(CreateProfileRequest::profileName)).setter(setter(Builder::profileName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProfileName").build()).build();
private static final SdkField TIMEZONE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Timezone").getter(getter(CreateProfileRequest::timezone)).setter(setter(Builder::timezone))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Timezone").build()).build();
private static final SdkField ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Address")
.getter(getter(CreateProfileRequest::address)).setter(setter(Builder::address))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Address").build()).build();
private static final SdkField DISTANCE_UNIT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DistanceUnit").getter(getter(CreateProfileRequest::distanceUnitAsString))
.setter(setter(Builder::distanceUnit))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DistanceUnit").build()).build();
private static final SdkField TEMPERATURE_UNIT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TemperatureUnit").getter(getter(CreateProfileRequest::temperatureUnitAsString))
.setter(setter(Builder::temperatureUnit))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TemperatureUnit").build()).build();
private static final SdkField WAKE_WORD_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("WakeWord").getter(getter(CreateProfileRequest::wakeWordAsString)).setter(setter(Builder::wakeWord))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WakeWord").build()).build();
private static final SdkField LOCALE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Locale")
.getter(getter(CreateProfileRequest::locale)).setter(setter(Builder::locale))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Locale").build()).build();
private static final SdkField CLIENT_REQUEST_TOKEN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ClientRequestToken")
.getter(getter(CreateProfileRequest::clientRequestToken))
.setter(setter(Builder::clientRequestToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClientRequestToken").build(),
DefaultValueTrait.idempotencyToken()).build();
private static final SdkField SETUP_MODE_DISABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("SetupModeDisabled").getter(getter(CreateProfileRequest::setupModeDisabled))
.setter(setter(Builder::setupModeDisabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SetupModeDisabled").build()).build();
private static final SdkField MAX_VOLUME_LIMIT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("MaxVolumeLimit").getter(getter(CreateProfileRequest::maxVolumeLimit))
.setter(setter(Builder::maxVolumeLimit))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxVolumeLimit").build()).build();
private static final SdkField PSTN_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("PSTNEnabled").getter(getter(CreateProfileRequest::pstnEnabled)).setter(setter(Builder::pstnEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PSTNEnabled").build()).build();
private static final SdkField DATA_RETENTION_OPT_IN_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("DataRetentionOptIn").getter(getter(CreateProfileRequest::dataRetentionOptIn))
.setter(setter(Builder::dataRetentionOptIn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataRetentionOptIn").build())
.build();
private static final SdkField MEETING_ROOM_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("MeetingRoomConfiguration")
.getter(getter(CreateProfileRequest::meetingRoomConfiguration)).setter(setter(Builder::meetingRoomConfiguration))
.constructor(CreateMeetingRoomConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MeetingRoomConfiguration").build())
.build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Tags")
.getter(getter(CreateProfileRequest::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Tag::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PROFILE_NAME_FIELD,
TIMEZONE_FIELD, ADDRESS_FIELD, DISTANCE_UNIT_FIELD, TEMPERATURE_UNIT_FIELD, WAKE_WORD_FIELD, LOCALE_FIELD,
CLIENT_REQUEST_TOKEN_FIELD, SETUP_MODE_DISABLED_FIELD, MAX_VOLUME_LIMIT_FIELD, PSTN_ENABLED_FIELD,
DATA_RETENTION_OPT_IN_FIELD, MEETING_ROOM_CONFIGURATION_FIELD, TAGS_FIELD));
private final String profileName;
private final String timezone;
private final String address;
private final String distanceUnit;
private final String temperatureUnit;
private final String wakeWord;
private final String locale;
private final String clientRequestToken;
private final Boolean setupModeDisabled;
private final Integer maxVolumeLimit;
private final Boolean pstnEnabled;
private final Boolean dataRetentionOptIn;
private final CreateMeetingRoomConfiguration meetingRoomConfiguration;
private final List tags;
private CreateProfileRequest(BuilderImpl builder) {
super(builder);
this.profileName = builder.profileName;
this.timezone = builder.timezone;
this.address = builder.address;
this.distanceUnit = builder.distanceUnit;
this.temperatureUnit = builder.temperatureUnit;
this.wakeWord = builder.wakeWord;
this.locale = builder.locale;
this.clientRequestToken = builder.clientRequestToken;
this.setupModeDisabled = builder.setupModeDisabled;
this.maxVolumeLimit = builder.maxVolumeLimit;
this.pstnEnabled = builder.pstnEnabled;
this.dataRetentionOptIn = builder.dataRetentionOptIn;
this.meetingRoomConfiguration = builder.meetingRoomConfiguration;
this.tags = builder.tags;
}
/**
*
* The name of a room profile.
*
*
* @return The name of a room profile.
*/
public final String profileName() {
return profileName;
}
/**
*
* The time zone used by a room profile.
*
*
* @return The time zone used by a room profile.
*/
public final String timezone() {
return timezone;
}
/**
*
* The valid address for the room.
*
*
* @return The valid address for the room.
*/
public final String address() {
return address;
}
/**
*
* The distance unit to be used by devices in the profile.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #distanceUnit} will
* return {@link DistanceUnit#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #distanceUnitAsString}.
*
*
* @return The distance unit to be used by devices in the profile.
* @see DistanceUnit
*/
public final DistanceUnit distanceUnit() {
return DistanceUnit.fromValue(distanceUnit);
}
/**
*
* The distance unit to be used by devices in the profile.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #distanceUnit} will
* return {@link DistanceUnit#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #distanceUnitAsString}.
*
*
* @return The distance unit to be used by devices in the profile.
* @see DistanceUnit
*/
public final String distanceUnitAsString() {
return distanceUnit;
}
/**
*
* The temperature unit to be used by devices in the profile.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #temperatureUnit}
* will return {@link TemperatureUnit#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #temperatureUnitAsString}.
*
*
* @return The temperature unit to be used by devices in the profile.
* @see TemperatureUnit
*/
public final TemperatureUnit temperatureUnit() {
return TemperatureUnit.fromValue(temperatureUnit);
}
/**
*
* The temperature unit to be used by devices in the profile.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #temperatureUnit}
* will return {@link TemperatureUnit#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #temperatureUnitAsString}.
*
*
* @return The temperature unit to be used by devices in the profile.
* @see TemperatureUnit
*/
public final String temperatureUnitAsString() {
return temperatureUnit;
}
/**
*
* A wake word for Alexa, Echo, Amazon, or a computer.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #wakeWord} will
* return {@link WakeWord#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #wakeWordAsString}.
*
*
* @return A wake word for Alexa, Echo, Amazon, or a computer.
* @see WakeWord
*/
public final WakeWord wakeWord() {
return WakeWord.fromValue(wakeWord);
}
/**
*
* A wake word for Alexa, Echo, Amazon, or a computer.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #wakeWord} will
* return {@link WakeWord#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #wakeWordAsString}.
*
*
* @return A wake word for Alexa, Echo, Amazon, or a computer.
* @see WakeWord
*/
public final String wakeWordAsString() {
return wakeWord;
}
/**
*
* The locale of the room profile. (This is currently only available to a limited preview audience.)
*
*
* @return The locale of the room profile. (This is currently only available to a limited preview audience.)
*/
public final String locale() {
return locale;
}
/**
*
* The user-specified token that is used during the creation of a profile.
*
*
* @return The user-specified token that is used during the creation of a profile.
*/
public final String clientRequestToken() {
return clientRequestToken;
}
/**
*
* Whether room profile setup is enabled.
*
*
* @return Whether room profile setup is enabled.
*/
public final Boolean setupModeDisabled() {
return setupModeDisabled;
}
/**
*
* The maximum volume limit for a room profile.
*
*
* @return The maximum volume limit for a room profile.
*/
public final Integer maxVolumeLimit() {
return maxVolumeLimit;
}
/**
*
* Whether PSTN calling is enabled.
*
*
* @return Whether PSTN calling is enabled.
*/
public final Boolean pstnEnabled() {
return pstnEnabled;
}
/**
*
* Whether data retention of the profile is enabled.
*
*
* @return Whether data retention of the profile is enabled.
*/
public final Boolean dataRetentionOptIn() {
return dataRetentionOptIn;
}
/**
*
* The meeting room settings of a room profile.
*
*
* @return The meeting room settings of a room profile.
*/
public final CreateMeetingRoomConfiguration meetingRoomConfiguration() {
return meetingRoomConfiguration;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructList);
}
/**
*
* The tags for the profile.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return The tags for the profile.
*/
public final List tags() {
return tags;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(profileName());
hashCode = 31 * hashCode + Objects.hashCode(timezone());
hashCode = 31 * hashCode + Objects.hashCode(address());
hashCode = 31 * hashCode + Objects.hashCode(distanceUnitAsString());
hashCode = 31 * hashCode + Objects.hashCode(temperatureUnitAsString());
hashCode = 31 * hashCode + Objects.hashCode(wakeWordAsString());
hashCode = 31 * hashCode + Objects.hashCode(locale());
hashCode = 31 * hashCode + Objects.hashCode(clientRequestToken());
hashCode = 31 * hashCode + Objects.hashCode(setupModeDisabled());
hashCode = 31 * hashCode + Objects.hashCode(maxVolumeLimit());
hashCode = 31 * hashCode + Objects.hashCode(pstnEnabled());
hashCode = 31 * hashCode + Objects.hashCode(dataRetentionOptIn());
hashCode = 31 * hashCode + Objects.hashCode(meetingRoomConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CreateProfileRequest)) {
return false;
}
CreateProfileRequest other = (CreateProfileRequest) obj;
return Objects.equals(profileName(), other.profileName()) && Objects.equals(timezone(), other.timezone())
&& Objects.equals(address(), other.address())
&& Objects.equals(distanceUnitAsString(), other.distanceUnitAsString())
&& Objects.equals(temperatureUnitAsString(), other.temperatureUnitAsString())
&& Objects.equals(wakeWordAsString(), other.wakeWordAsString()) && Objects.equals(locale(), other.locale())
&& Objects.equals(clientRequestToken(), other.clientRequestToken())
&& Objects.equals(setupModeDisabled(), other.setupModeDisabled())
&& Objects.equals(maxVolumeLimit(), other.maxVolumeLimit()) && Objects.equals(pstnEnabled(), other.pstnEnabled())
&& Objects.equals(dataRetentionOptIn(), other.dataRetentionOptIn())
&& Objects.equals(meetingRoomConfiguration(), other.meetingRoomConfiguration()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags());
}
/**
* 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("CreateProfileRequest").add("ProfileName", profileName()).add("Timezone", timezone())
.add("Address", address()).add("DistanceUnit", distanceUnitAsString())
.add("TemperatureUnit", temperatureUnitAsString()).add("WakeWord", wakeWordAsString()).add("Locale", locale())
.add("ClientRequestToken", clientRequestToken()).add("SetupModeDisabled", setupModeDisabled())
.add("MaxVolumeLimit", maxVolumeLimit()).add("PSTNEnabled", pstnEnabled())
.add("DataRetentionOptIn", dataRetentionOptIn()).add("MeetingRoomConfiguration", meetingRoomConfiguration())
.add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ProfileName":
return Optional.ofNullable(clazz.cast(profileName()));
case "Timezone":
return Optional.ofNullable(clazz.cast(timezone()));
case "Address":
return Optional.ofNullable(clazz.cast(address()));
case "DistanceUnit":
return Optional.ofNullable(clazz.cast(distanceUnitAsString()));
case "TemperatureUnit":
return Optional.ofNullable(clazz.cast(temperatureUnitAsString()));
case "WakeWord":
return Optional.ofNullable(clazz.cast(wakeWordAsString()));
case "Locale":
return Optional.ofNullable(clazz.cast(locale()));
case "ClientRequestToken":
return Optional.ofNullable(clazz.cast(clientRequestToken()));
case "SetupModeDisabled":
return Optional.ofNullable(clazz.cast(setupModeDisabled()));
case "MaxVolumeLimit":
return Optional.ofNullable(clazz.cast(maxVolumeLimit()));
case "PSTNEnabled":
return Optional.ofNullable(clazz.cast(pstnEnabled()));
case "DataRetentionOptIn":
return Optional.ofNullable(clazz.cast(dataRetentionOptIn()));
case "MeetingRoomConfiguration":
return Optional.ofNullable(clazz.cast(meetingRoomConfiguration()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function