
software.amazon.awssdk.services.workmail.model.DescribeOrganizationResponse 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.time.Instant;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DescribeOrganizationResponse extends WorkMailResponse implements
ToCopyableBuilder {
private static final SdkField ORGANIZATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OrganizationId").getter(getter(DescribeOrganizationResponse::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(DescribeOrganizationResponse::alias)).setter(setter(Builder::alias))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Alias").build()).build();
private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("State")
.getter(getter(DescribeOrganizationResponse::state)).setter(setter(Builder::state))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State").build()).build();
private static final SdkField DIRECTORY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DirectoryId").getter(getter(DescribeOrganizationResponse::directoryId))
.setter(setter(Builder::directoryId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DirectoryId").build()).build();
private static final SdkField DIRECTORY_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DirectoryType").getter(getter(DescribeOrganizationResponse::directoryType))
.setter(setter(Builder::directoryType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DirectoryType").build()).build();
private static final SdkField DEFAULT_MAIL_DOMAIN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DefaultMailDomain").getter(getter(DescribeOrganizationResponse::defaultMailDomain))
.setter(setter(Builder::defaultMailDomain))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultMailDomain").build()).build();
private static final SdkField COMPLETED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CompletedDate").getter(getter(DescribeOrganizationResponse::completedDate))
.setter(setter(Builder::completedDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompletedDate").build()).build();
private static final SdkField ERROR_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ErrorMessage").getter(getter(DescribeOrganizationResponse::errorMessage))
.setter(setter(Builder::errorMessage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ErrorMessage").build()).build();
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("ARN")
.getter(getter(DescribeOrganizationResponse::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ARN").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ORGANIZATION_ID_FIELD,
ALIAS_FIELD, STATE_FIELD, DIRECTORY_ID_FIELD, DIRECTORY_TYPE_FIELD, DEFAULT_MAIL_DOMAIN_FIELD, COMPLETED_DATE_FIELD,
ERROR_MESSAGE_FIELD, ARN_FIELD));
private final String organizationId;
private final String alias;
private final String state;
private final String directoryId;
private final String directoryType;
private final String defaultMailDomain;
private final Instant completedDate;
private final String errorMessage;
private final String arn;
private DescribeOrganizationResponse(BuilderImpl builder) {
super(builder);
this.organizationId = builder.organizationId;
this.alias = builder.alias;
this.state = builder.state;
this.directoryId = builder.directoryId;
this.directoryType = builder.directoryType;
this.defaultMailDomain = builder.defaultMailDomain;
this.completedDate = builder.completedDate;
this.errorMessage = builder.errorMessage;
this.arn = builder.arn;
}
/**
*
* The identifier of an organization.
*
*
* @return The identifier of an organization.
*/
public final String organizationId() {
return organizationId;
}
/**
*
* The alias for an organization.
*
*
* @return The alias for an organization.
*/
public final String alias() {
return alias;
}
/**
*
* The state of an organization.
*
*
* @return The state of an organization.
*/
public final String state() {
return state;
}
/**
*
* The identifier for the directory associated with an WorkMail organization.
*
*
* @return The identifier for the directory associated with an WorkMail organization.
*/
public final String directoryId() {
return directoryId;
}
/**
*
* The type of directory associated with the WorkMail organization.
*
*
* @return The type of directory associated with the WorkMail organization.
*/
public final String directoryType() {
return directoryType;
}
/**
*
* The default mail domain associated with the organization.
*
*
* @return The default mail domain associated with the organization.
*/
public final String defaultMailDomain() {
return defaultMailDomain;
}
/**
*
* The date at which the organization became usable in the WorkMail context, in UNIX epoch time format.
*
*
* @return The date at which the organization became usable in the WorkMail context, in UNIX epoch time format.
*/
public final Instant completedDate() {
return completedDate;
}
/**
*
* (Optional) The error message indicating if unexpected behavior was encountered with regards to the organization.
*
*
* @return (Optional) The error message indicating if unexpected behavior was encountered with regards to the
* organization.
*/
public final String errorMessage() {
return errorMessage;
}
/**
*
* The Amazon Resource Name (ARN) of the organization.
*
*
* @return The Amazon Resource Name (ARN) of the organization.
*/
public final String arn() {
return arn;
}
@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(organizationId());
hashCode = 31 * hashCode + Objects.hashCode(alias());
hashCode = 31 * hashCode + Objects.hashCode(state());
hashCode = 31 * hashCode + Objects.hashCode(directoryId());
hashCode = 31 * hashCode + Objects.hashCode(directoryType());
hashCode = 31 * hashCode + Objects.hashCode(defaultMailDomain());
hashCode = 31 * hashCode + Objects.hashCode(completedDate());
hashCode = 31 * hashCode + Objects.hashCode(errorMessage());
hashCode = 31 * hashCode + Objects.hashCode(arn());
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 DescribeOrganizationResponse)) {
return false;
}
DescribeOrganizationResponse other = (DescribeOrganizationResponse) obj;
return Objects.equals(organizationId(), other.organizationId()) && Objects.equals(alias(), other.alias())
&& Objects.equals(state(), other.state()) && Objects.equals(directoryId(), other.directoryId())
&& Objects.equals(directoryType(), other.directoryType())
&& Objects.equals(defaultMailDomain(), other.defaultMailDomain())
&& Objects.equals(completedDate(), other.completedDate()) && Objects.equals(errorMessage(), other.errorMessage())
&& Objects.equals(arn(), other.arn());
}
/**
* 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("DescribeOrganizationResponse").add("OrganizationId", organizationId()).add("Alias", alias())
.add("State", state()).add("DirectoryId", directoryId()).add("DirectoryType", directoryType())
.add("DefaultMailDomain", defaultMailDomain()).add("CompletedDate", completedDate())
.add("ErrorMessage", errorMessage()).add("ARN", arn()).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 "State":
return Optional.ofNullable(clazz.cast(state()));
case "DirectoryId":
return Optional.ofNullable(clazz.cast(directoryId()));
case "DirectoryType":
return Optional.ofNullable(clazz.cast(directoryType()));
case "DefaultMailDomain":
return Optional.ofNullable(clazz.cast(defaultMailDomain()));
case "CompletedDate":
return Optional.ofNullable(clazz.cast(completedDate()));
case "ErrorMessage":
return Optional.ofNullable(clazz.cast(errorMessage()));
case "ARN":
return Optional.ofNullable(clazz.cast(arn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy