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

software.amazon.awssdk.services.connect.model.InstanceSummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Connect module holds the client classes that are used for communicating with Connect.

There is a newer version: 2.29.15
Show newest version
/*
 * 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.connect.model;

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

/**
 * 

* Information about the instance. *

*/ @Generated("software.amazon.awssdk:codegen") public final class InstanceSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id") .getter(getter(InstanceSummary::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build(); private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn") .getter(getter(InstanceSummary::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build(); private static final SdkField IDENTITY_MANAGEMENT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("IdentityManagementType").getter(getter(InstanceSummary::identityManagementTypeAsString)) .setter(setter(Builder::identityManagementType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdentityManagementType").build()) .build(); private static final SdkField INSTANCE_ALIAS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("InstanceAlias").getter(getter(InstanceSummary::instanceAlias)).setter(setter(Builder::instanceAlias)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceAlias").build()).build(); private static final SdkField CREATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("CreatedTime").getter(getter(InstanceSummary::createdTime)).setter(setter(Builder::createdTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedTime").build()).build(); private static final SdkField SERVICE_ROLE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ServiceRole").getter(getter(InstanceSummary::serviceRole)).setter(setter(Builder::serviceRole)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceRole").build()).build(); private static final SdkField INSTANCE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("InstanceStatus").getter(getter(InstanceSummary::instanceStatusAsString)) .setter(setter(Builder::instanceStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceStatus").build()).build(); private static final SdkField INBOUND_CALLS_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("InboundCallsEnabled").getter(getter(InstanceSummary::inboundCallsEnabled)) .setter(setter(Builder::inboundCallsEnabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InboundCallsEnabled").build()) .build(); private static final SdkField OUTBOUND_CALLS_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("OutboundCallsEnabled").getter(getter(InstanceSummary::outboundCallsEnabled)) .setter(setter(Builder::outboundCallsEnabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutboundCallsEnabled").build()) .build(); private static final SdkField INSTANCE_ACCESS_URL_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("InstanceAccessUrl").getter(getter(InstanceSummary::instanceAccessUrl)) .setter(setter(Builder::instanceAccessUrl)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceAccessUrl").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, ARN_FIELD, IDENTITY_MANAGEMENT_TYPE_FIELD, INSTANCE_ALIAS_FIELD, CREATED_TIME_FIELD, SERVICE_ROLE_FIELD, INSTANCE_STATUS_FIELD, INBOUND_CALLS_ENABLED_FIELD, OUTBOUND_CALLS_ENABLED_FIELD, INSTANCE_ACCESS_URL_FIELD)); private static final long serialVersionUID = 1L; private final String id; private final String arn; private final String identityManagementType; private final String instanceAlias; private final Instant createdTime; private final String serviceRole; private final String instanceStatus; private final Boolean inboundCallsEnabled; private final Boolean outboundCallsEnabled; private final String instanceAccessUrl; private InstanceSummary(BuilderImpl builder) { this.id = builder.id; this.arn = builder.arn; this.identityManagementType = builder.identityManagementType; this.instanceAlias = builder.instanceAlias; this.createdTime = builder.createdTime; this.serviceRole = builder.serviceRole; this.instanceStatus = builder.instanceStatus; this.inboundCallsEnabled = builder.inboundCallsEnabled; this.outboundCallsEnabled = builder.outboundCallsEnabled; this.instanceAccessUrl = builder.instanceAccessUrl; } /** *

* The identifier of the instance. *

* * @return The identifier of the instance. */ public final String id() { return id; } /** *

* The Amazon Resource Name (ARN) of the instance. *

* * @return The Amazon Resource Name (ARN) of the instance. */ public final String arn() { return arn; } /** *

* The identity management type of the instance. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #identityManagementType} will return {@link DirectoryType#UNKNOWN_TO_SDK_VERSION}. The raw value returned * by the service is available from {@link #identityManagementTypeAsString}. *

* * @return The identity management type of the instance. * @see DirectoryType */ public final DirectoryType identityManagementType() { return DirectoryType.fromValue(identityManagementType); } /** *

* The identity management type of the instance. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #identityManagementType} will return {@link DirectoryType#UNKNOWN_TO_SDK_VERSION}. The raw value returned * by the service is available from {@link #identityManagementTypeAsString}. *

* * @return The identity management type of the instance. * @see DirectoryType */ public final String identityManagementTypeAsString() { return identityManagementType; } /** *

* The alias of the instance. *

* * @return The alias of the instance. */ public final String instanceAlias() { return instanceAlias; } /** *

* When the instance was created. *

* * @return When the instance was created. */ public final Instant createdTime() { return createdTime; } /** *

* The service role of the instance. *

* * @return The service role of the instance. */ public final String serviceRole() { return serviceRole; } /** *

* The state of the instance. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #instanceStatus} * will return {@link InstanceStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #instanceStatusAsString}. *

* * @return The state of the instance. * @see InstanceStatus */ public final InstanceStatus instanceStatus() { return InstanceStatus.fromValue(instanceStatus); } /** *

* The state of the instance. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #instanceStatus} * will return {@link InstanceStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #instanceStatusAsString}. *

* * @return The state of the instance. * @see InstanceStatus */ public final String instanceStatusAsString() { return instanceStatus; } /** *

* Whether inbound calls are enabled. *

* * @return Whether inbound calls are enabled. */ public final Boolean inboundCallsEnabled() { return inboundCallsEnabled; } /** *

* Whether outbound calls are enabled. *

* * @return Whether outbound calls are enabled. */ public final Boolean outboundCallsEnabled() { return outboundCallsEnabled; } /** *

* This URL allows contact center users to access the Amazon Connect admin website. *

* * @return This URL allows contact center users to access the Amazon Connect admin website. */ public final String instanceAccessUrl() { return instanceAccessUrl; } @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(id()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(identityManagementTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(instanceAlias()); hashCode = 31 * hashCode + Objects.hashCode(createdTime()); hashCode = 31 * hashCode + Objects.hashCode(serviceRole()); hashCode = 31 * hashCode + Objects.hashCode(instanceStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(inboundCallsEnabled()); hashCode = 31 * hashCode + Objects.hashCode(outboundCallsEnabled()); hashCode = 31 * hashCode + Objects.hashCode(instanceAccessUrl()); 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 InstanceSummary)) { return false; } InstanceSummary other = (InstanceSummary) obj; return Objects.equals(id(), other.id()) && Objects.equals(arn(), other.arn()) && Objects.equals(identityManagementTypeAsString(), other.identityManagementTypeAsString()) && Objects.equals(instanceAlias(), other.instanceAlias()) && Objects.equals(createdTime(), other.createdTime()) && Objects.equals(serviceRole(), other.serviceRole()) && Objects.equals(instanceStatusAsString(), other.instanceStatusAsString()) && Objects.equals(inboundCallsEnabled(), other.inboundCallsEnabled()) && Objects.equals(outboundCallsEnabled(), other.outboundCallsEnabled()) && Objects.equals(instanceAccessUrl(), other.instanceAccessUrl()); } /** * 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("InstanceSummary").add("Id", id()).add("Arn", arn()) .add("IdentityManagementType", identityManagementTypeAsString()) .add("InstanceAlias", instanceAlias() == null ? null : "*** Sensitive Data Redacted ***") .add("CreatedTime", createdTime()).add("ServiceRole", serviceRole()) .add("InstanceStatus", instanceStatusAsString()).add("InboundCallsEnabled", inboundCallsEnabled()) .add("OutboundCallsEnabled", outboundCallsEnabled()).add("InstanceAccessUrl", instanceAccessUrl()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Id": return Optional.ofNullable(clazz.cast(id())); case "Arn": return Optional.ofNullable(clazz.cast(arn())); case "IdentityManagementType": return Optional.ofNullable(clazz.cast(identityManagementTypeAsString())); case "InstanceAlias": return Optional.ofNullable(clazz.cast(instanceAlias())); case "CreatedTime": return Optional.ofNullable(clazz.cast(createdTime())); case "ServiceRole": return Optional.ofNullable(clazz.cast(serviceRole())); case "InstanceStatus": return Optional.ofNullable(clazz.cast(instanceStatusAsString())); case "InboundCallsEnabled": return Optional.ofNullable(clazz.cast(inboundCallsEnabled())); case "OutboundCallsEnabled": return Optional.ofNullable(clazz.cast(outboundCallsEnabled())); case "InstanceAccessUrl": return Optional.ofNullable(clazz.cast(instanceAccessUrl())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((InstanceSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The identifier of the instance. *

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

* The Amazon Resource Name (ARN) of the instance. *

* * @param arn * The Amazon Resource Name (ARN) of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* The identity management type of the instance. *

* * @param identityManagementType * The identity management type of the instance. * @see DirectoryType * @return Returns a reference to this object so that method calls can be chained together. * @see DirectoryType */ Builder identityManagementType(String identityManagementType); /** *

* The identity management type of the instance. *

* * @param identityManagementType * The identity management type of the instance. * @see DirectoryType * @return Returns a reference to this object so that method calls can be chained together. * @see DirectoryType */ Builder identityManagementType(DirectoryType identityManagementType); /** *

* The alias of the instance. *

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

* When the instance was created. *

* * @param createdTime * When the instance was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdTime(Instant createdTime); /** *

* The service role of the instance. *

* * @param serviceRole * The service role of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceRole(String serviceRole); /** *

* The state of the instance. *

* * @param instanceStatus * The state of the instance. * @see InstanceStatus * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceStatus */ Builder instanceStatus(String instanceStatus); /** *

* The state of the instance. *

* * @param instanceStatus * The state of the instance. * @see InstanceStatus * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceStatus */ Builder instanceStatus(InstanceStatus instanceStatus); /** *

* Whether inbound calls are enabled. *

* * @param inboundCallsEnabled * Whether inbound calls are enabled. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inboundCallsEnabled(Boolean inboundCallsEnabled); /** *

* Whether outbound calls are enabled. *

* * @param outboundCallsEnabled * Whether outbound calls are enabled. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outboundCallsEnabled(Boolean outboundCallsEnabled); /** *

* This URL allows contact center users to access the Amazon Connect admin website. *

* * @param instanceAccessUrl * This URL allows contact center users to access the Amazon Connect admin website. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceAccessUrl(String instanceAccessUrl); } static final class BuilderImpl implements Builder { private String id; private String arn; private String identityManagementType; private String instanceAlias; private Instant createdTime; private String serviceRole; private String instanceStatus; private Boolean inboundCallsEnabled; private Boolean outboundCallsEnabled; private String instanceAccessUrl; private BuilderImpl() { } private BuilderImpl(InstanceSummary model) { id(model.id); arn(model.arn); identityManagementType(model.identityManagementType); instanceAlias(model.instanceAlias); createdTime(model.createdTime); serviceRole(model.serviceRole); instanceStatus(model.instanceStatus); inboundCallsEnabled(model.inboundCallsEnabled); outboundCallsEnabled(model.outboundCallsEnabled); instanceAccessUrl(model.instanceAccessUrl); } public final String getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getIdentityManagementType() { return identityManagementType; } public final void setIdentityManagementType(String identityManagementType) { this.identityManagementType = identityManagementType; } @Override public final Builder identityManagementType(String identityManagementType) { this.identityManagementType = identityManagementType; return this; } @Override public final Builder identityManagementType(DirectoryType identityManagementType) { this.identityManagementType(identityManagementType == null ? null : identityManagementType.toString()); return this; } public final String getInstanceAlias() { return instanceAlias; } public final void setInstanceAlias(String instanceAlias) { this.instanceAlias = instanceAlias; } @Override public final Builder instanceAlias(String instanceAlias) { this.instanceAlias = instanceAlias; return this; } public final Instant getCreatedTime() { return createdTime; } public final void setCreatedTime(Instant createdTime) { this.createdTime = createdTime; } @Override public final Builder createdTime(Instant createdTime) { this.createdTime = createdTime; return this; } public final String getServiceRole() { return serviceRole; } public final void setServiceRole(String serviceRole) { this.serviceRole = serviceRole; } @Override public final Builder serviceRole(String serviceRole) { this.serviceRole = serviceRole; return this; } public final String getInstanceStatus() { return instanceStatus; } public final void setInstanceStatus(String instanceStatus) { this.instanceStatus = instanceStatus; } @Override public final Builder instanceStatus(String instanceStatus) { this.instanceStatus = instanceStatus; return this; } @Override public final Builder instanceStatus(InstanceStatus instanceStatus) { this.instanceStatus(instanceStatus == null ? null : instanceStatus.toString()); return this; } public final Boolean getInboundCallsEnabled() { return inboundCallsEnabled; } public final void setInboundCallsEnabled(Boolean inboundCallsEnabled) { this.inboundCallsEnabled = inboundCallsEnabled; } @Override public final Builder inboundCallsEnabled(Boolean inboundCallsEnabled) { this.inboundCallsEnabled = inboundCallsEnabled; return this; } public final Boolean getOutboundCallsEnabled() { return outboundCallsEnabled; } public final void setOutboundCallsEnabled(Boolean outboundCallsEnabled) { this.outboundCallsEnabled = outboundCallsEnabled; } @Override public final Builder outboundCallsEnabled(Boolean outboundCallsEnabled) { this.outboundCallsEnabled = outboundCallsEnabled; return this; } public final String getInstanceAccessUrl() { return instanceAccessUrl; } public final void setInstanceAccessUrl(String instanceAccessUrl) { this.instanceAccessUrl = instanceAccessUrl; } @Override public final Builder instanceAccessUrl(String instanceAccessUrl) { this.instanceAccessUrl = instanceAccessUrl; return this; } @Override public InstanceSummary build() { return new InstanceSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy