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

software.amazon.awssdk.services.customerprofiles.model.PutIntegrationRequest Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.28.3
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.customerprofiles.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 PutIntegrationRequest extends CustomerProfilesRequest implements
        ToCopyableBuilder {
    private static final SdkField DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DomainName").getter(getter(PutIntegrationRequest::domainName)).setter(setter(Builder::domainName))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("DomainName").build()).build();

    private static final SdkField URI_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Uri")
            .getter(getter(PutIntegrationRequest::uri)).setter(setter(Builder::uri))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Uri").build()).build();

    private static final SdkField OBJECT_TYPE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ObjectTypeName").getter(getter(PutIntegrationRequest::objectTypeName))
            .setter(setter(Builder::objectTypeName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ObjectTypeName").build()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("Tags")
            .getter(getter(PutIntegrationRequest::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 SdkField FLOW_DEFINITION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("FlowDefinition")
            .getter(getter(PutIntegrationRequest::flowDefinition)).setter(setter(Builder::flowDefinition))
            .constructor(FlowDefinition::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FlowDefinition").build()).build();

    private static final SdkField> OBJECT_TYPE_NAMES_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("ObjectTypeNames")
            .getter(getter(PutIntegrationRequest::objectTypeNames))
            .setter(setter(Builder::objectTypeNames))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ObjectTypeNames").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(DOMAIN_NAME_FIELD, URI_FIELD,
            OBJECT_TYPE_NAME_FIELD, TAGS_FIELD, FLOW_DEFINITION_FIELD, OBJECT_TYPE_NAMES_FIELD));

    private final String domainName;

    private final String uri;

    private final String objectTypeName;

    private final Map tags;

    private final FlowDefinition flowDefinition;

    private final Map objectTypeNames;

    private PutIntegrationRequest(BuilderImpl builder) {
        super(builder);
        this.domainName = builder.domainName;
        this.uri = builder.uri;
        this.objectTypeName = builder.objectTypeName;
        this.tags = builder.tags;
        this.flowDefinition = builder.flowDefinition;
        this.objectTypeNames = builder.objectTypeNames;
    }

    /**
     * 

* The unique name of the domain. *

* * @return The unique name of the domain. */ public final String domainName() { return domainName; } /** *

* The URI of the S3 bucket or any other type of data source. *

* * @return The URI of the S3 bucket or any other type of data source. */ public final String uri() { return uri; } /** *

* The name of the profile object type. *

* * @return The name of the profile object type. */ public final String objectTypeName() { return objectTypeName; } /** * 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. *

*

* 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. */ public final Map tags() { return tags; } /** *

* The configuration that controls how Customer Profiles retrieves data from the source. *

* * @return The configuration that controls how Customer Profiles retrieves data from the source. */ public final FlowDefinition flowDefinition() { return flowDefinition; } /** * For responses, this returns true if the service returned a value for the ObjectTypeNames 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 hasObjectTypeNames() { return objectTypeNames != null && !(objectTypeNames instanceof SdkAutoConstructMap); } /** *

* A map in which each key is an event type from an external application such as Segment or Shopify, and each value * is an ObjectTypeName (template) used to ingest the event. It supports the following event types: * SegmentIdentify, ShopifyCreateCustomers, ShopifyUpdateCustomers, * ShopifyCreateDraftOrders, ShopifyUpdateDraftOrders, ShopifyCreateOrders, * and ShopifyUpdatedOrders. *

*

* 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 #hasObjectTypeNames} method. *

* * @return A map in which each key is an event type from an external application such as Segment or Shopify, and * each value is an ObjectTypeName (template) used to ingest the event. It supports the * following event types: SegmentIdentify, ShopifyCreateCustomers, * ShopifyUpdateCustomers, ShopifyCreateDraftOrders, * ShopifyUpdateDraftOrders, ShopifyCreateOrders, and * ShopifyUpdatedOrders. */ public final Map objectTypeNames() { return objectTypeNames; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(domainName()); hashCode = 31 * hashCode + Objects.hashCode(uri()); hashCode = 31 * hashCode + Objects.hashCode(objectTypeName()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(flowDefinition()); hashCode = 31 * hashCode + Objects.hashCode(hasObjectTypeNames() ? objectTypeNames() : 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 PutIntegrationRequest)) { return false; } PutIntegrationRequest other = (PutIntegrationRequest) obj; return Objects.equals(domainName(), other.domainName()) && Objects.equals(uri(), other.uri()) && Objects.equals(objectTypeName(), other.objectTypeName()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(flowDefinition(), other.flowDefinition()) && hasObjectTypeNames() == other.hasObjectTypeNames() && Objects.equals(objectTypeNames(), other.objectTypeNames()); } /** * 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("PutIntegrationRequest").add("DomainName", domainName()).add("Uri", uri()) .add("ObjectTypeName", objectTypeName()).add("Tags", hasTags() ? tags() : null) .add("FlowDefinition", flowDefinition() == null ? null : "*** Sensitive Data Redacted ***") .add("ObjectTypeNames", hasObjectTypeNames() ? objectTypeNames() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DomainName": return Optional.ofNullable(clazz.cast(domainName())); case "Uri": return Optional.ofNullable(clazz.cast(uri())); case "ObjectTypeName": return Optional.ofNullable(clazz.cast(objectTypeName())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "FlowDefinition": return Optional.ofNullable(clazz.cast(flowDefinition())); case "ObjectTypeNames": return Optional.ofNullable(clazz.cast(objectTypeNames())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((PutIntegrationRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends CustomerProfilesRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The unique name of the domain. *

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

* The URI of the S3 bucket or any other type of data source. *

* * @param uri * The URI of the S3 bucket or any other type of data source. * @return Returns a reference to this object so that method calls can be chained together. */ Builder uri(String uri); /** *

* The name of the profile object type. *

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

* The tags used to organize, track, or control access for this resource. *

* * @param tags * The tags used to organize, track, or control access for this resource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); /** *

* The configuration that controls how Customer Profiles retrieves data from the source. *

* * @param flowDefinition * The configuration that controls how Customer Profiles retrieves data from the source. * @return Returns a reference to this object so that method calls can be chained together. */ Builder flowDefinition(FlowDefinition flowDefinition); /** *

* The configuration that controls how Customer Profiles retrieves data from the source. *

* This is a convenience method that creates an instance of the {@link FlowDefinition.Builder} avoiding the need * to create one manually via {@link FlowDefinition#builder()}. * *

* When the {@link Consumer} completes, {@link FlowDefinition.Builder#build()} is called immediately and its * result is passed to {@link #flowDefinition(FlowDefinition)}. * * @param flowDefinition * a consumer that will call methods on {@link FlowDefinition.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #flowDefinition(FlowDefinition) */ default Builder flowDefinition(Consumer flowDefinition) { return flowDefinition(FlowDefinition.builder().applyMutation(flowDefinition).build()); } /** *

* A map in which each key is an event type from an external application such as Segment or Shopify, and each * value is an ObjectTypeName (template) used to ingest the event. It supports the following event * types: SegmentIdentify, ShopifyCreateCustomers, ShopifyUpdateCustomers, ShopifyCreateDraftOrders, ShopifyUpdateDraftOrders, * ShopifyCreateOrders, and ShopifyUpdatedOrders. *

* * @param objectTypeNames * A map in which each key is an event type from an external application such as Segment or Shopify, and * each value is an ObjectTypeName (template) used to ingest the event. It supports the * following event types: SegmentIdentify, ShopifyCreateCustomers, * ShopifyUpdateCustomers, ShopifyCreateDraftOrders, * ShopifyUpdateDraftOrders, ShopifyCreateOrders, and * ShopifyUpdatedOrders. * @return Returns a reference to this object so that method calls can be chained together. */ Builder objectTypeNames(Map objectTypeNames); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends CustomerProfilesRequest.BuilderImpl implements Builder { private String domainName; private String uri; private String objectTypeName; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private FlowDefinition flowDefinition; private Map objectTypeNames = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(PutIntegrationRequest model) { super(model); domainName(model.domainName); uri(model.uri); objectTypeName(model.objectTypeName); tags(model.tags); flowDefinition(model.flowDefinition); objectTypeNames(model.objectTypeNames); } public final String getDomainName() { return domainName; } public final void setDomainName(String domainName) { this.domainName = domainName; } @Override public final Builder domainName(String domainName) { this.domainName = domainName; return this; } public final String getUri() { return uri; } public final void setUri(String uri) { this.uri = uri; } @Override public final Builder uri(String uri) { this.uri = uri; return this; } public final String getObjectTypeName() { return objectTypeName; } public final void setObjectTypeName(String objectTypeName) { this.objectTypeName = objectTypeName; } @Override public final Builder objectTypeName(String objectTypeName) { this.objectTypeName = objectTypeName; 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; } public final FlowDefinition.Builder getFlowDefinition() { return flowDefinition != null ? flowDefinition.toBuilder() : null; } public final void setFlowDefinition(FlowDefinition.BuilderImpl flowDefinition) { this.flowDefinition = flowDefinition != null ? flowDefinition.build() : null; } @Override public final Builder flowDefinition(FlowDefinition flowDefinition) { this.flowDefinition = flowDefinition; return this; } public final Map getObjectTypeNames() { if (objectTypeNames instanceof SdkAutoConstructMap) { return null; } return objectTypeNames; } public final void setObjectTypeNames(Map objectTypeNames) { this.objectTypeNames = ObjectTypeNamesCopier.copy(objectTypeNames); } @Override public final Builder objectTypeNames(Map objectTypeNames) { this.objectTypeNames = ObjectTypeNamesCopier.copy(objectTypeNames); 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 PutIntegrationRequest build() { return new PutIntegrationRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy