Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.connect.model.CreateIntegrationAssociationRequest Maven / Gradle / Ivy
Go to download
The AWS Java SDK for Connect module holds the client classes that are used for
communicating with Connect.
/*
* 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.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
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.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
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 CreateIntegrationAssociationRequest extends ConnectRequest implements
ToCopyableBuilder {
private static final SdkField INSTANCE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("InstanceId").getter(getter(CreateIntegrationAssociationRequest::instanceId))
.setter(setter(Builder::instanceId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("InstanceId").build()).build();
private static final SdkField INTEGRATION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IntegrationType").getter(getter(CreateIntegrationAssociationRequest::integrationTypeAsString))
.setter(setter(Builder::integrationType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegrationType").build()).build();
private static final SdkField INTEGRATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IntegrationArn").getter(getter(CreateIntegrationAssociationRequest::integrationArn))
.setter(setter(Builder::integrationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegrationArn").build()).build();
private static final SdkField SOURCE_APPLICATION_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceApplicationUrl").getter(getter(CreateIntegrationAssociationRequest::sourceApplicationUrl))
.setter(setter(Builder::sourceApplicationUrl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceApplicationUrl").build())
.build();
private static final SdkField SOURCE_APPLICATION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceApplicationName").getter(getter(CreateIntegrationAssociationRequest::sourceApplicationName))
.setter(setter(Builder::sourceApplicationName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceApplicationName").build())
.build();
private static final SdkField SOURCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceType").getter(getter(CreateIntegrationAssociationRequest::sourceTypeAsString))
.setter(setter(Builder::sourceType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceType").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Tags")
.getter(getter(CreateIntegrationAssociationRequest::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(INSTANCE_ID_FIELD,
INTEGRATION_TYPE_FIELD, INTEGRATION_ARN_FIELD, SOURCE_APPLICATION_URL_FIELD, SOURCE_APPLICATION_NAME_FIELD,
SOURCE_TYPE_FIELD, TAGS_FIELD));
private final String instanceId;
private final String integrationType;
private final String integrationArn;
private final String sourceApplicationUrl;
private final String sourceApplicationName;
private final String sourceType;
private final Map tags;
private CreateIntegrationAssociationRequest(BuilderImpl builder) {
super(builder);
this.instanceId = builder.instanceId;
this.integrationType = builder.integrationType;
this.integrationArn = builder.integrationArn;
this.sourceApplicationUrl = builder.sourceApplicationUrl;
this.sourceApplicationName = builder.sourceApplicationName;
this.sourceType = builder.sourceType;
this.tags = builder.tags;
}
/**
*
* The identifier of the Amazon Connect instance. You can find the instance ID in
* the Amazon Resource Name (ARN) of the instance.
*
*
* @return The identifier of the Amazon Connect instance. You can find the instance
* ID in the Amazon Resource Name (ARN) of the instance.
*/
public final String instanceId() {
return instanceId;
}
/**
*
* The type of information to be ingested.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #integrationType}
* will return {@link IntegrationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #integrationTypeAsString}.
*
*
* @return The type of information to be ingested.
* @see IntegrationType
*/
public final IntegrationType integrationType() {
return IntegrationType.fromValue(integrationType);
}
/**
*
* The type of information to be ingested.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #integrationType}
* will return {@link IntegrationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #integrationTypeAsString}.
*
*
* @return The type of information to be ingested.
* @see IntegrationType
*/
public final String integrationTypeAsString() {
return integrationType;
}
/**
*
* The Amazon Resource Name (ARN) of the integration.
*
*
*
* When integrating with Amazon Pinpoint, the Amazon Connect and Amazon Pinpoint instances must be in the same
* account.
*
*
*
* @return The Amazon Resource Name (ARN) of the integration.
*
* When integrating with Amazon Pinpoint, the Amazon Connect and Amazon Pinpoint instances must be in the
* same account.
*
*/
public final String integrationArn() {
return integrationArn;
}
/**
*
* The URL for the external application. This field is only required for the EVENT integration type.
*
*
* @return The URL for the external application. This field is only required for the EVENT integration type.
*/
public final String sourceApplicationUrl() {
return sourceApplicationUrl;
}
/**
*
* The name of the external application. This field is only required for the EVENT integration type.
*
*
* @return The name of the external application. This field is only required for the EVENT integration type.
*/
public final String sourceApplicationName() {
return sourceApplicationName;
}
/**
*
* The type of the data source. This field is only required for the EVENT integration type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sourceType} will
* return {@link SourceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sourceTypeAsString}.
*
*
* @return The type of the data source. This field is only required for the EVENT integration type.
* @see SourceType
*/
public final SourceType sourceType() {
return SourceType.fromValue(sourceType);
}
/**
*
* The type of the data source. This field is only required for the EVENT integration type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sourceType} will
* return {@link SourceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sourceTypeAsString}.
*
*
* @return The type of the data source. This field is only required for the EVENT integration type.
* @see SourceType
*/
public final String sourceTypeAsString() {
return sourceType;
}
/**
* 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 SdkAutoConstructMap);
}
/**
*
* The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1",
* "key2":"value2"} }.
*
*
* 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 used to organize, track, or control access for this resource. For example, { "tags":
* {"key1":"value1", "key2":"value2"} }.
*/
public final Map 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(instanceId());
hashCode = 31 * hashCode + Objects.hashCode(integrationTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(integrationArn());
hashCode = 31 * hashCode + Objects.hashCode(sourceApplicationUrl());
hashCode = 31 * hashCode + Objects.hashCode(sourceApplicationName());
hashCode = 31 * hashCode + Objects.hashCode(sourceTypeAsString());
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 CreateIntegrationAssociationRequest)) {
return false;
}
CreateIntegrationAssociationRequest other = (CreateIntegrationAssociationRequest) obj;
return Objects.equals(instanceId(), other.instanceId())
&& Objects.equals(integrationTypeAsString(), other.integrationTypeAsString())
&& Objects.equals(integrationArn(), other.integrationArn())
&& Objects.equals(sourceApplicationUrl(), other.sourceApplicationUrl())
&& Objects.equals(sourceApplicationName(), other.sourceApplicationName())
&& Objects.equals(sourceTypeAsString(), other.sourceTypeAsString()) && 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("CreateIntegrationAssociationRequest").add("InstanceId", instanceId())
.add("IntegrationType", integrationTypeAsString()).add("IntegrationArn", integrationArn())
.add("SourceApplicationUrl", sourceApplicationUrl()).add("SourceApplicationName", sourceApplicationName())
.add("SourceType", sourceTypeAsString()).add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "InstanceId":
return Optional.ofNullable(clazz.cast(instanceId()));
case "IntegrationType":
return Optional.ofNullable(clazz.cast(integrationTypeAsString()));
case "IntegrationArn":
return Optional.ofNullable(clazz.cast(integrationArn()));
case "SourceApplicationUrl":
return Optional.ofNullable(clazz.cast(sourceApplicationUrl()));
case "SourceApplicationName":
return Optional.ofNullable(clazz.cast(sourceApplicationName()));
case "SourceType":
return Optional.ofNullable(clazz.cast(sourceTypeAsString()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((CreateIntegrationAssociationRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends ConnectRequest.Builder, SdkPojo,
CopyableBuilder {
/**
*
* The identifier of the Amazon Connect instance. You can find the instance ID
* in the Amazon Resource Name (ARN) of the instance.
*
*
* @param instanceId
* The identifier of the Amazon Connect instance. You can find the instance
* ID in the Amazon Resource Name (ARN) of the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder instanceId(String instanceId);
/**
*
* The type of information to be ingested.
*
*
* @param integrationType
* The type of information to be ingested.
* @see IntegrationType
* @return Returns a reference to this object so that method calls can be chained together.
* @see IntegrationType
*/
Builder integrationType(String integrationType);
/**
*
* The type of information to be ingested.
*
*
* @param integrationType
* The type of information to be ingested.
* @see IntegrationType
* @return Returns a reference to this object so that method calls can be chained together.
* @see IntegrationType
*/
Builder integrationType(IntegrationType integrationType);
/**
*
* The Amazon Resource Name (ARN) of the integration.
*
*
*
* When integrating with Amazon Pinpoint, the Amazon Connect and Amazon Pinpoint instances must be in the same
* account.
*
*
*
* @param integrationArn
* The Amazon Resource Name (ARN) of the integration.
*
* When integrating with Amazon Pinpoint, the Amazon Connect and Amazon Pinpoint instances must be in the
* same account.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integrationArn(String integrationArn);
/**
*
* The URL for the external application. This field is only required for the EVENT integration type.
*
*
* @param sourceApplicationUrl
* The URL for the external application. This field is only required for the EVENT integration type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sourceApplicationUrl(String sourceApplicationUrl);
/**
*
* The name of the external application. This field is only required for the EVENT integration type.
*
*
* @param sourceApplicationName
* The name of the external application. This field is only required for the EVENT integration type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sourceApplicationName(String sourceApplicationName);
/**
*
* The type of the data source. This field is only required for the EVENT integration type.
*
*
* @param sourceType
* The type of the data source. This field is only required for the EVENT integration type.
* @see SourceType
* @return Returns a reference to this object so that method calls can be chained together.
* @see SourceType
*/
Builder sourceType(String sourceType);
/**
*
* The type of the data source. This field is only required for the EVENT integration type.
*
*
* @param sourceType
* The type of the data source. This field is only required for the EVENT integration type.
* @see SourceType
* @return Returns a reference to this object so that method calls can be chained together.
* @see SourceType
*/
Builder sourceType(SourceType sourceType);
/**
*
* The tags used to organize, track, or control access for this resource. For example, { "tags":
* {"key1":"value1", "key2":"value2"} }.
*
*
* @param tags
* The tags used to organize, track, or control access for this resource. For example, { "tags":
* {"key1":"value1", "key2":"value2"} }.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends ConnectRequest.BuilderImpl implements Builder {
private String instanceId;
private String integrationType;
private String integrationArn;
private String sourceApplicationUrl;
private String sourceApplicationName;
private String sourceType;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(CreateIntegrationAssociationRequest model) {
super(model);
instanceId(model.instanceId);
integrationType(model.integrationType);
integrationArn(model.integrationArn);
sourceApplicationUrl(model.sourceApplicationUrl);
sourceApplicationName(model.sourceApplicationName);
sourceType(model.sourceType);
tags(model.tags);
}
public final String getInstanceId() {
return instanceId;
}
public final void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
@Override
public final Builder instanceId(String instanceId) {
this.instanceId = instanceId;
return this;
}
public final String getIntegrationType() {
return integrationType;
}
public final void setIntegrationType(String integrationType) {
this.integrationType = integrationType;
}
@Override
public final Builder integrationType(String integrationType) {
this.integrationType = integrationType;
return this;
}
@Override
public final Builder integrationType(IntegrationType integrationType) {
this.integrationType(integrationType == null ? null : integrationType.toString());
return this;
}
public final String getIntegrationArn() {
return integrationArn;
}
public final void setIntegrationArn(String integrationArn) {
this.integrationArn = integrationArn;
}
@Override
public final Builder integrationArn(String integrationArn) {
this.integrationArn = integrationArn;
return this;
}
public final String getSourceApplicationUrl() {
return sourceApplicationUrl;
}
public final void setSourceApplicationUrl(String sourceApplicationUrl) {
this.sourceApplicationUrl = sourceApplicationUrl;
}
@Override
public final Builder sourceApplicationUrl(String sourceApplicationUrl) {
this.sourceApplicationUrl = sourceApplicationUrl;
return this;
}
public final String getSourceApplicationName() {
return sourceApplicationName;
}
public final void setSourceApplicationName(String sourceApplicationName) {
this.sourceApplicationName = sourceApplicationName;
}
@Override
public final Builder sourceApplicationName(String sourceApplicationName) {
this.sourceApplicationName = sourceApplicationName;
return this;
}
public final String getSourceType() {
return sourceType;
}
public final void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
@Override
public final Builder sourceType(String sourceType) {
this.sourceType = sourceType;
return this;
}
@Override
public final Builder sourceType(SourceType sourceType) {
this.sourceType(sourceType == null ? null : sourceType.toString());
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = TagMapCopier.copy(tags);
}
@Override
public final Builder tags(Map tags) {
this.tags = TagMapCopier.copy(tags);
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public CreateIntegrationAssociationRequest build() {
return new CreateIntegrationAssociationRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}