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

software.amazon.awssdk.services.workmail.model.OrganizationSummary 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.workmail.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 representation of an organization. *

*/ @Generated("software.amazon.awssdk:codegen") public final class OrganizationSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ORGANIZATION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("OrganizationId").getter(getter(OrganizationSummary::organizationId)) .setter(setter(Builder::organizationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OrganizationId").build()).build(); private static final SdkField ALIAS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Alias") .getter(getter(OrganizationSummary::alias)).setter(setter(Builder::alias)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Alias").build()).build(); private static final SdkField DEFAULT_MAIL_DOMAIN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DefaultMailDomain").getter(getter(OrganizationSummary::defaultMailDomain)) .setter(setter(Builder::defaultMailDomain)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultMailDomain").build()).build(); private static final SdkField ERROR_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ErrorMessage").getter(getter(OrganizationSummary::errorMessage)).setter(setter(Builder::errorMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ErrorMessage").build()).build(); private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("State") .getter(getter(OrganizationSummary::state)).setter(setter(Builder::state)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ORGANIZATION_ID_FIELD, ALIAS_FIELD, DEFAULT_MAIL_DOMAIN_FIELD, ERROR_MESSAGE_FIELD, STATE_FIELD)); private static final long serialVersionUID = 1L; private final String organizationId; private final String alias; private final String defaultMailDomain; private final String errorMessage; private final String state; private OrganizationSummary(BuilderImpl builder) { this.organizationId = builder.organizationId; this.alias = builder.alias; this.defaultMailDomain = builder.defaultMailDomain; this.errorMessage = builder.errorMessage; this.state = builder.state; } /** *

* The identifier associated with the organization. *

* * @return The identifier associated with the organization. */ public final String organizationId() { return organizationId; } /** *

* The alias associated with the organization. *

* * @return The alias associated with the organization. */ public final String alias() { return alias; } /** *

* The default email domain associated with the organization. *

* * @return The default email domain associated with the organization. */ public final String defaultMailDomain() { return defaultMailDomain; } /** *

* The error message associated with the organization. It is only present if unexpected behavior has occurred with * regards to the organization. It provides insight or solutions regarding unexpected behavior. *

* * @return The error message associated with the organization. It is only present if unexpected behavior has * occurred with regards to the organization. It provides insight or solutions regarding unexpected * behavior. */ public final String errorMessage() { return errorMessage; } /** *

* The state associated with the organization. *

* * @return The state associated with the organization. */ public final String state() { return state; } @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(organizationId()); hashCode = 31 * hashCode + Objects.hashCode(alias()); hashCode = 31 * hashCode + Objects.hashCode(defaultMailDomain()); hashCode = 31 * hashCode + Objects.hashCode(errorMessage()); hashCode = 31 * hashCode + Objects.hashCode(state()); 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 OrganizationSummary)) { return false; } OrganizationSummary other = (OrganizationSummary) obj; return Objects.equals(organizationId(), other.organizationId()) && Objects.equals(alias(), other.alias()) && Objects.equals(defaultMailDomain(), other.defaultMailDomain()) && Objects.equals(errorMessage(), other.errorMessage()) && Objects.equals(state(), other.state()); } /** * 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("OrganizationSummary").add("OrganizationId", organizationId()).add("Alias", alias()) .add("DefaultMailDomain", defaultMailDomain()).add("ErrorMessage", errorMessage()).add("State", state()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "OrganizationId": return Optional.ofNullable(clazz.cast(organizationId())); case "Alias": return Optional.ofNullable(clazz.cast(alias())); case "DefaultMailDomain": return Optional.ofNullable(clazz.cast(defaultMailDomain())); case "ErrorMessage": return Optional.ofNullable(clazz.cast(errorMessage())); case "State": return Optional.ofNullable(clazz.cast(state())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((OrganizationSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The identifier associated with the organization. *

* * @param organizationId * The identifier associated with the organization. * @return Returns a reference to this object so that method calls can be chained together. */ Builder organizationId(String organizationId); /** *

* The alias associated with the organization. *

* * @param alias * The alias associated with the organization. * @return Returns a reference to this object so that method calls can be chained together. */ Builder alias(String alias); /** *

* The default email domain associated with the organization. *

* * @param defaultMailDomain * The default email domain associated with the organization. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultMailDomain(String defaultMailDomain); /** *

* The error message associated with the organization. It is only present if unexpected behavior has occurred * with regards to the organization. It provides insight or solutions regarding unexpected behavior. *

* * @param errorMessage * The error message associated with the organization. It is only present if unexpected behavior has * occurred with regards to the organization. It provides insight or solutions regarding unexpected * behavior. * @return Returns a reference to this object so that method calls can be chained together. */ Builder errorMessage(String errorMessage); /** *

* The state associated with the organization. *

* * @param state * The state associated with the organization. * @return Returns a reference to this object so that method calls can be chained together. */ Builder state(String state); } static final class BuilderImpl implements Builder { private String organizationId; private String alias; private String defaultMailDomain; private String errorMessage; private String state; private BuilderImpl() { } private BuilderImpl(OrganizationSummary model) { organizationId(model.organizationId); alias(model.alias); defaultMailDomain(model.defaultMailDomain); errorMessage(model.errorMessage); state(model.state); } public final String getOrganizationId() { return organizationId; } public final void setOrganizationId(String organizationId) { this.organizationId = organizationId; } @Override public final Builder organizationId(String organizationId) { this.organizationId = organizationId; return this; } public final String getAlias() { return alias; } public final void setAlias(String alias) { this.alias = alias; } @Override public final Builder alias(String alias) { this.alias = alias; return this; } public final String getDefaultMailDomain() { return defaultMailDomain; } public final void setDefaultMailDomain(String defaultMailDomain) { this.defaultMailDomain = defaultMailDomain; } @Override public final Builder defaultMailDomain(String defaultMailDomain) { this.defaultMailDomain = defaultMailDomain; return this; } public final String getErrorMessage() { return errorMessage; } public final void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } @Override public final Builder errorMessage(String errorMessage) { this.errorMessage = errorMessage; return this; } public final String getState() { return state; } public final void setState(String state) { this.state = state; } @Override public final Builder state(String state) { this.state = state; return this; } @Override public OrganizationSummary build() { return new OrganizationSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy