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

software.amazon.awssdk.services.alexaforbusiness.model.ProfileData 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.alexaforbusiness.model;

import java.io.Serializable;
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;

/**
 * 

* The data of a room profile. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ProfileData implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField PROFILE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ProfileData::profileArn)).setter(setter(Builder::profileArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProfileArn").build()).build(); private static final SdkField PROFILE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ProfileData::profileName)).setter(setter(Builder::profileName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProfileName").build()).build(); private static final SdkField IS_DEFAULT_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .getter(getter(ProfileData::isDefault)).setter(setter(Builder::isDefault)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsDefault").build()).build(); private static final SdkField ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ProfileData::address)).setter(setter(Builder::address)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Address").build()).build(); private static final SdkField TIMEZONE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ProfileData::timezone)).setter(setter(Builder::timezone)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Timezone").build()).build(); private static final SdkField DISTANCE_UNIT_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ProfileData::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) .getter(getter(ProfileData::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) .getter(getter(ProfileData::wakeWordAsString)).setter(setter(Builder::wakeWord)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WakeWord").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PROFILE_ARN_FIELD, PROFILE_NAME_FIELD, IS_DEFAULT_FIELD, ADDRESS_FIELD, TIMEZONE_FIELD, DISTANCE_UNIT_FIELD, TEMPERATURE_UNIT_FIELD, WAKE_WORD_FIELD)); private static final long serialVersionUID = 1L; private final String profileArn; private final String profileName; private final Boolean isDefault; private final String address; private final String timezone; private final String distanceUnit; private final String temperatureUnit; private final String wakeWord; private ProfileData(BuilderImpl builder) { this.profileArn = builder.profileArn; this.profileName = builder.profileName; this.isDefault = builder.isDefault; this.address = builder.address; this.timezone = builder.timezone; this.distanceUnit = builder.distanceUnit; this.temperatureUnit = builder.temperatureUnit; this.wakeWord = builder.wakeWord; } /** *

* The ARN of a room profile. *

* * @return The ARN of a room profile. */ public String profileArn() { return profileArn; } /** *

* The name of a room profile. *

* * @return The name of a room profile. */ public String profileName() { return profileName; } /** *

* Retrieves if the profile data is default or not. *

* * @return Retrieves if the profile data is default or not. */ public Boolean isDefault() { return isDefault; } /** *

* The address of a room profile. *

* * @return The address of a room profile. */ public String address() { return address; } /** *

* The timezone of a room profile. *

* * @return The timezone of a room profile. */ public String timezone() { return timezone; } /** *

* The distance unit of a room 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 of a room profile. * @see DistanceUnit */ public DistanceUnit distanceUnit() { return DistanceUnit.fromValue(distanceUnit); } /** *

* The distance unit of a room 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 of a room profile. * @see DistanceUnit */ public String distanceUnitAsString() { return distanceUnit; } /** *

* The temperature unit of a room 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 of a room profile. * @see TemperatureUnit */ public TemperatureUnit temperatureUnit() { return TemperatureUnit.fromValue(temperatureUnit); } /** *

* The temperature unit of a room 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 of a room profile. * @see TemperatureUnit */ public String temperatureUnitAsString() { return temperatureUnit; } /** *

* The wake word of a room profile. *

*

* 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 The wake word of a room profile. * @see WakeWord */ public WakeWord wakeWord() { return WakeWord.fromValue(wakeWord); } /** *

* The wake word of a room profile. *

*

* 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 The wake word of a room profile. * @see WakeWord */ public String wakeWordAsString() { return wakeWord; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(profileArn()); hashCode = 31 * hashCode + Objects.hashCode(profileName()); hashCode = 31 * hashCode + Objects.hashCode(isDefault()); hashCode = 31 * hashCode + Objects.hashCode(address()); hashCode = 31 * hashCode + Objects.hashCode(timezone()); hashCode = 31 * hashCode + Objects.hashCode(distanceUnitAsString()); hashCode = 31 * hashCode + Objects.hashCode(temperatureUnitAsString()); hashCode = 31 * hashCode + Objects.hashCode(wakeWordAsString()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ProfileData)) { return false; } ProfileData other = (ProfileData) obj; return Objects.equals(profileArn(), other.profileArn()) && Objects.equals(profileName(), other.profileName()) && Objects.equals(isDefault(), other.isDefault()) && Objects.equals(address(), other.address()) && Objects.equals(timezone(), other.timezone()) && Objects.equals(distanceUnitAsString(), other.distanceUnitAsString()) && Objects.equals(temperatureUnitAsString(), other.temperatureUnitAsString()) && Objects.equals(wakeWordAsString(), other.wakeWordAsString()); } /** * 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("ProfileData").add("ProfileArn", profileArn()).add("ProfileName", profileName()) .add("IsDefault", isDefault()).add("Address", address()).add("Timezone", timezone()) .add("DistanceUnit", distanceUnitAsString()).add("TemperatureUnit", temperatureUnitAsString()) .add("WakeWord", wakeWordAsString()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ProfileArn": return Optional.ofNullable(clazz.cast(profileArn())); case "ProfileName": return Optional.ofNullable(clazz.cast(profileName())); case "IsDefault": return Optional.ofNullable(clazz.cast(isDefault())); case "Address": return Optional.ofNullable(clazz.cast(address())); case "Timezone": return Optional.ofNullable(clazz.cast(timezone())); case "DistanceUnit": return Optional.ofNullable(clazz.cast(distanceUnitAsString())); case "TemperatureUnit": return Optional.ofNullable(clazz.cast(temperatureUnitAsString())); case "WakeWord": return Optional.ofNullable(clazz.cast(wakeWordAsString())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ProfileData) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ARN of a room profile. *

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

* The name of a room profile. *

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

* Retrieves if the profile data is default or not. *

* * @param isDefault * Retrieves if the profile data is default or not. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isDefault(Boolean isDefault); /** *

* The address of a room profile. *

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

* The timezone of a room profile. *

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

* The distance unit of a room profile. *

* * @param distanceUnit * The distance unit of a room profile. * @see DistanceUnit * @return Returns a reference to this object so that method calls can be chained together. * @see DistanceUnit */ Builder distanceUnit(String distanceUnit); /** *

* The distance unit of a room profile. *

* * @param distanceUnit * The distance unit of a room profile. * @see DistanceUnit * @return Returns a reference to this object so that method calls can be chained together. * @see DistanceUnit */ Builder distanceUnit(DistanceUnit distanceUnit); /** *

* The temperature unit of a room profile. *

* * @param temperatureUnit * The temperature unit of a room profile. * @see TemperatureUnit * @return Returns a reference to this object so that method calls can be chained together. * @see TemperatureUnit */ Builder temperatureUnit(String temperatureUnit); /** *

* The temperature unit of a room profile. *

* * @param temperatureUnit * The temperature unit of a room profile. * @see TemperatureUnit * @return Returns a reference to this object so that method calls can be chained together. * @see TemperatureUnit */ Builder temperatureUnit(TemperatureUnit temperatureUnit); /** *

* The wake word of a room profile. *

* * @param wakeWord * The wake word of a room profile. * @see WakeWord * @return Returns a reference to this object so that method calls can be chained together. * @see WakeWord */ Builder wakeWord(String wakeWord); /** *

* The wake word of a room profile. *

* * @param wakeWord * The wake word of a room profile. * @see WakeWord * @return Returns a reference to this object so that method calls can be chained together. * @see WakeWord */ Builder wakeWord(WakeWord wakeWord); } static final class BuilderImpl implements Builder { private String profileArn; private String profileName; private Boolean isDefault; private String address; private String timezone; private String distanceUnit; private String temperatureUnit; private String wakeWord; private BuilderImpl() { } private BuilderImpl(ProfileData model) { profileArn(model.profileArn); profileName(model.profileName); isDefault(model.isDefault); address(model.address); timezone(model.timezone); distanceUnit(model.distanceUnit); temperatureUnit(model.temperatureUnit); wakeWord(model.wakeWord); } public final String getProfileArn() { return profileArn; } @Override public final Builder profileArn(String profileArn) { this.profileArn = profileArn; return this; } public final void setProfileArn(String profileArn) { this.profileArn = profileArn; } public final String getProfileName() { return profileName; } @Override public final Builder profileName(String profileName) { this.profileName = profileName; return this; } public final void setProfileName(String profileName) { this.profileName = profileName; } public final Boolean getIsDefault() { return isDefault; } @Override public final Builder isDefault(Boolean isDefault) { this.isDefault = isDefault; return this; } public final void setIsDefault(Boolean isDefault) { this.isDefault = isDefault; } public final String getAddress() { return address; } @Override public final Builder address(String address) { this.address = address; return this; } public final void setAddress(String address) { this.address = address; } public final String getTimezone() { return timezone; } @Override public final Builder timezone(String timezone) { this.timezone = timezone; return this; } public final void setTimezone(String timezone) { this.timezone = timezone; } public final String getDistanceUnitAsString() { return distanceUnit; } @Override public final Builder distanceUnit(String distanceUnit) { this.distanceUnit = distanceUnit; return this; } @Override public final Builder distanceUnit(DistanceUnit distanceUnit) { this.distanceUnit(distanceUnit.toString()); return this; } public final void setDistanceUnit(String distanceUnit) { this.distanceUnit = distanceUnit; } public final String getTemperatureUnitAsString() { return temperatureUnit; } @Override public final Builder temperatureUnit(String temperatureUnit) { this.temperatureUnit = temperatureUnit; return this; } @Override public final Builder temperatureUnit(TemperatureUnit temperatureUnit) { this.temperatureUnit(temperatureUnit.toString()); return this; } public final void setTemperatureUnit(String temperatureUnit) { this.temperatureUnit = temperatureUnit; } public final String getWakeWordAsString() { return wakeWord; } @Override public final Builder wakeWord(String wakeWord) { this.wakeWord = wakeWord; return this; } @Override public final Builder wakeWord(WakeWord wakeWord) { this.wakeWord(wakeWord.toString()); return this; } public final void setWakeWord(String wakeWord) { this.wakeWord = wakeWord; } @Override public ProfileData build() { return new ProfileData(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy