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

software.amazon.awssdk.services.pinpoint.model.APNSChannelResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Pinpoint module holds the client classes that are used for communicating with Amazon Pinpoint Service

There is a newer version: 2.28.4
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.pinpoint.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;

/**
 * 

* Provides information about the status and settings of the APNs (Apple Push Notification service) channel for an * application. *

*/ @Generated("software.amazon.awssdk:codegen") public final class APNSChannelResponse implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField APPLICATION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ApplicationId").getter(getter(APNSChannelResponse::applicationId)) .setter(setter(Builder::applicationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationId").build()).build(); private static final SdkField CREATION_DATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CreationDate").getter(getter(APNSChannelResponse::creationDate)).setter(setter(Builder::creationDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationDate").build()).build(); private static final SdkField DEFAULT_AUTHENTICATION_METHOD_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("DefaultAuthenticationMethod") .getter(getter(APNSChannelResponse::defaultAuthenticationMethod)) .setter(setter(Builder::defaultAuthenticationMethod)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultAuthenticationMethod") .build()).build(); private static final SdkField ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("Enabled").getter(getter(APNSChannelResponse::enabled)).setter(setter(Builder::enabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Enabled").build()).build(); private static final SdkField HAS_CREDENTIAL_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("HasCredential").getter(getter(APNSChannelResponse::hasCredential)) .setter(setter(Builder::hasCredential)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HasCredential").build()).build(); private static final SdkField HAS_TOKEN_KEY_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("HasTokenKey").getter(getter(APNSChannelResponse::hasTokenKey)).setter(setter(Builder::hasTokenKey)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HasTokenKey").build()).build(); private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id") .getter(getter(APNSChannelResponse::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build(); private static final SdkField IS_ARCHIVED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("IsArchived").getter(getter(APNSChannelResponse::isArchived)).setter(setter(Builder::isArchived)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsArchived").build()).build(); private static final SdkField LAST_MODIFIED_BY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LastModifiedBy").getter(getter(APNSChannelResponse::lastModifiedBy)) .setter(setter(Builder::lastModifiedBy)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedBy").build()).build(); private static final SdkField LAST_MODIFIED_DATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LastModifiedDate").getter(getter(APNSChannelResponse::lastModifiedDate)) .setter(setter(Builder::lastModifiedDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedDate").build()).build(); private static final SdkField PLATFORM_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Platform").getter(getter(APNSChannelResponse::platform)).setter(setter(Builder::platform)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Platform").build()).build(); private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("Version").getter(getter(APNSChannelResponse::version)).setter(setter(Builder::version)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Version").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APPLICATION_ID_FIELD, CREATION_DATE_FIELD, DEFAULT_AUTHENTICATION_METHOD_FIELD, ENABLED_FIELD, HAS_CREDENTIAL_FIELD, HAS_TOKEN_KEY_FIELD, ID_FIELD, IS_ARCHIVED_FIELD, LAST_MODIFIED_BY_FIELD, LAST_MODIFIED_DATE_FIELD, PLATFORM_FIELD, VERSION_FIELD)); private static final long serialVersionUID = 1L; private final String applicationId; private final String creationDate; private final String defaultAuthenticationMethod; private final Boolean enabled; private final Boolean hasCredential; private final Boolean hasTokenKey; private final String id; private final Boolean isArchived; private final String lastModifiedBy; private final String lastModifiedDate; private final String platform; private final Integer version; private APNSChannelResponse(BuilderImpl builder) { this.applicationId = builder.applicationId; this.creationDate = builder.creationDate; this.defaultAuthenticationMethod = builder.defaultAuthenticationMethod; this.enabled = builder.enabled; this.hasCredential = builder.hasCredential; this.hasTokenKey = builder.hasTokenKey; this.id = builder.id; this.isArchived = builder.isArchived; this.lastModifiedBy = builder.lastModifiedBy; this.lastModifiedDate = builder.lastModifiedDate; this.platform = builder.platform; this.version = builder.version; } /** *

* The unique identifier for the application that the APNs channel applies to. *

* * @return The unique identifier for the application that the APNs channel applies to. */ public final String applicationId() { return applicationId; } /** *

* The date and time when the APNs channel was enabled. *

* * @return The date and time when the APNs channel was enabled. */ public final String creationDate() { return creationDate; } /** *

* The default authentication method that Amazon Pinpoint uses to authenticate with APNs for this channel, key or * certificate. *

* * @return The default authentication method that Amazon Pinpoint uses to authenticate with APNs for this channel, * key or certificate. */ public final String defaultAuthenticationMethod() { return defaultAuthenticationMethod; } /** *

* Specifies whether the APNs channel is enabled for the application. *

* * @return Specifies whether the APNs channel is enabled for the application. */ public final Boolean enabled() { return enabled; } /** *

* (Not used) This property is retained only for backward compatibility. *

* * @return (Not used) This property is retained only for backward compatibility. */ public final Boolean hasCredential() { return hasCredential; } /** *

* Specifies whether the APNs channel is configured to communicate with APNs by using APNs tokens. To provide an * authentication key for APNs tokens, set the TokenKey property of the channel. *

* * @return Specifies whether the APNs channel is configured to communicate with APNs by using APNs tokens. To * provide an authentication key for APNs tokens, set the TokenKey property of the channel. */ public final Boolean hasTokenKey() { return hasTokenKey; } /** *

* (Deprecated) An identifier for the APNs channel. This property is retained only for backward compatibility. *

* * @return (Deprecated) An identifier for the APNs channel. This property is retained only for backward * compatibility. */ public final String id() { return id; } /** *

* Specifies whether the APNs channel is archived. *

* * @return Specifies whether the APNs channel is archived. */ public final Boolean isArchived() { return isArchived; } /** *

* The user who last modified the APNs channel. *

* * @return The user who last modified the APNs channel. */ public final String lastModifiedBy() { return lastModifiedBy; } /** *

* The date and time when the APNs channel was last modified. *

* * @return The date and time when the APNs channel was last modified. */ public final String lastModifiedDate() { return lastModifiedDate; } /** *

* The type of messaging or notification platform for the channel. For the APNs channel, this value is APNS. *

* * @return

* The type of messaging or notification platform for the channel. For the APNs channel, this value is APNS. *

*/ public final String platform() { return platform; } /** *

* The current version of the APNs channel. *

* * @return The current version of the APNs channel. */ public final Integer version() { return version; } @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(applicationId()); hashCode = 31 * hashCode + Objects.hashCode(creationDate()); hashCode = 31 * hashCode + Objects.hashCode(defaultAuthenticationMethod()); hashCode = 31 * hashCode + Objects.hashCode(enabled()); hashCode = 31 * hashCode + Objects.hashCode(hasCredential()); hashCode = 31 * hashCode + Objects.hashCode(hasTokenKey()); hashCode = 31 * hashCode + Objects.hashCode(id()); hashCode = 31 * hashCode + Objects.hashCode(isArchived()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedBy()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedDate()); hashCode = 31 * hashCode + Objects.hashCode(platform()); hashCode = 31 * hashCode + Objects.hashCode(version()); 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 APNSChannelResponse)) { return false; } APNSChannelResponse other = (APNSChannelResponse) obj; return Objects.equals(applicationId(), other.applicationId()) && Objects.equals(creationDate(), other.creationDate()) && Objects.equals(defaultAuthenticationMethod(), other.defaultAuthenticationMethod()) && Objects.equals(enabled(), other.enabled()) && Objects.equals(hasCredential(), other.hasCredential()) && Objects.equals(hasTokenKey(), other.hasTokenKey()) && Objects.equals(id(), other.id()) && Objects.equals(isArchived(), other.isArchived()) && Objects.equals(lastModifiedBy(), other.lastModifiedBy()) && Objects.equals(lastModifiedDate(), other.lastModifiedDate()) && Objects.equals(platform(), other.platform()) && Objects.equals(version(), other.version()); } /** * 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("APNSChannelResponse").add("ApplicationId", applicationId()).add("CreationDate", creationDate()) .add("DefaultAuthenticationMethod", defaultAuthenticationMethod()).add("Enabled", enabled()) .add("HasCredential", hasCredential()).add("HasTokenKey", hasTokenKey()).add("Id", id()) .add("IsArchived", isArchived()).add("LastModifiedBy", lastModifiedBy()) .add("LastModifiedDate", lastModifiedDate()).add("Platform", platform()).add("Version", version()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ApplicationId": return Optional.ofNullable(clazz.cast(applicationId())); case "CreationDate": return Optional.ofNullable(clazz.cast(creationDate())); case "DefaultAuthenticationMethod": return Optional.ofNullable(clazz.cast(defaultAuthenticationMethod())); case "Enabled": return Optional.ofNullable(clazz.cast(enabled())); case "HasCredential": return Optional.ofNullable(clazz.cast(hasCredential())); case "HasTokenKey": return Optional.ofNullable(clazz.cast(hasTokenKey())); case "Id": return Optional.ofNullable(clazz.cast(id())); case "IsArchived": return Optional.ofNullable(clazz.cast(isArchived())); case "LastModifiedBy": return Optional.ofNullable(clazz.cast(lastModifiedBy())); case "LastModifiedDate": return Optional.ofNullable(clazz.cast(lastModifiedDate())); case "Platform": return Optional.ofNullable(clazz.cast(platform())); case "Version": return Optional.ofNullable(clazz.cast(version())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((APNSChannelResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The unique identifier for the application that the APNs channel applies to. *

* * @param applicationId * The unique identifier for the application that the APNs channel applies to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder applicationId(String applicationId); /** *

* The date and time when the APNs channel was enabled. *

* * @param creationDate * The date and time when the APNs channel was enabled. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationDate(String creationDate); /** *

* The default authentication method that Amazon Pinpoint uses to authenticate with APNs for this channel, key * or certificate. *

* * @param defaultAuthenticationMethod * The default authentication method that Amazon Pinpoint uses to authenticate with APNs for this * channel, key or certificate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultAuthenticationMethod(String defaultAuthenticationMethod); /** *

* Specifies whether the APNs channel is enabled for the application. *

* * @param enabled * Specifies whether the APNs channel is enabled for the application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enabled(Boolean enabled); /** *

* (Not used) This property is retained only for backward compatibility. *

* * @param hasCredential * (Not used) This property is retained only for backward compatibility. * @return Returns a reference to this object so that method calls can be chained together. */ Builder hasCredential(Boolean hasCredential); /** *

* Specifies whether the APNs channel is configured to communicate with APNs by using APNs tokens. To provide an * authentication key for APNs tokens, set the TokenKey property of the channel. *

* * @param hasTokenKey * Specifies whether the APNs channel is configured to communicate with APNs by using APNs tokens. To * provide an authentication key for APNs tokens, set the TokenKey property of the channel. * @return Returns a reference to this object so that method calls can be chained together. */ Builder hasTokenKey(Boolean hasTokenKey); /** *

* (Deprecated) An identifier for the APNs channel. This property is retained only for backward compatibility. *

* * @param id * (Deprecated) An identifier for the APNs channel. This property is retained only for backward * compatibility. * @return Returns a reference to this object so that method calls can be chained together. */ Builder id(String id); /** *

* Specifies whether the APNs channel is archived. *

* * @param isArchived * Specifies whether the APNs channel is archived. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isArchived(Boolean isArchived); /** *

* The user who last modified the APNs channel. *

* * @param lastModifiedBy * The user who last modified the APNs channel. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedBy(String lastModifiedBy); /** *

* The date and time when the APNs channel was last modified. *

* * @param lastModifiedDate * The date and time when the APNs channel was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedDate(String lastModifiedDate); /** *

* The type of messaging or notification platform for the channel. For the APNs channel, this value is APNS. *

* * @param platform *

* The type of messaging or notification platform for the channel. For the APNs channel, this value is * APNS. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder platform(String platform); /** *

* The current version of the APNs channel. *

* * @param version * The current version of the APNs channel. * @return Returns a reference to this object so that method calls can be chained together. */ Builder version(Integer version); } static final class BuilderImpl implements Builder { private String applicationId; private String creationDate; private String defaultAuthenticationMethod; private Boolean enabled; private Boolean hasCredential; private Boolean hasTokenKey; private String id; private Boolean isArchived; private String lastModifiedBy; private String lastModifiedDate; private String platform; private Integer version; private BuilderImpl() { } private BuilderImpl(APNSChannelResponse model) { applicationId(model.applicationId); creationDate(model.creationDate); defaultAuthenticationMethod(model.defaultAuthenticationMethod); enabled(model.enabled); hasCredential(model.hasCredential); hasTokenKey(model.hasTokenKey); id(model.id); isArchived(model.isArchived); lastModifiedBy(model.lastModifiedBy); lastModifiedDate(model.lastModifiedDate); platform(model.platform); version(model.version); } public final String getApplicationId() { return applicationId; } public final void setApplicationId(String applicationId) { this.applicationId = applicationId; } @Override public final Builder applicationId(String applicationId) { this.applicationId = applicationId; return this; } public final String getCreationDate() { return creationDate; } public final void setCreationDate(String creationDate) { this.creationDate = creationDate; } @Override public final Builder creationDate(String creationDate) { this.creationDate = creationDate; return this; } public final String getDefaultAuthenticationMethod() { return defaultAuthenticationMethod; } public final void setDefaultAuthenticationMethod(String defaultAuthenticationMethod) { this.defaultAuthenticationMethod = defaultAuthenticationMethod; } @Override public final Builder defaultAuthenticationMethod(String defaultAuthenticationMethod) { this.defaultAuthenticationMethod = defaultAuthenticationMethod; return this; } public final Boolean getEnabled() { return enabled; } public final void setEnabled(Boolean enabled) { this.enabled = enabled; } @Override public final Builder enabled(Boolean enabled) { this.enabled = enabled; return this; } public final Boolean getHasCredential() { return hasCredential; } public final void setHasCredential(Boolean hasCredential) { this.hasCredential = hasCredential; } @Override public final Builder hasCredential(Boolean hasCredential) { this.hasCredential = hasCredential; return this; } public final Boolean getHasTokenKey() { return hasTokenKey; } public final void setHasTokenKey(Boolean hasTokenKey) { this.hasTokenKey = hasTokenKey; } @Override public final Builder hasTokenKey(Boolean hasTokenKey) { this.hasTokenKey = hasTokenKey; return this; } 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 Boolean getIsArchived() { return isArchived; } public final void setIsArchived(Boolean isArchived) { this.isArchived = isArchived; } @Override public final Builder isArchived(Boolean isArchived) { this.isArchived = isArchived; return this; } public final String getLastModifiedBy() { return lastModifiedBy; } public final void setLastModifiedBy(String lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; } @Override public final Builder lastModifiedBy(String lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; return this; } public final String getLastModifiedDate() { return lastModifiedDate; } public final void setLastModifiedDate(String lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } @Override public final Builder lastModifiedDate(String lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; return this; } public final String getPlatform() { return platform; } public final void setPlatform(String platform) { this.platform = platform; } @Override public final Builder platform(String platform) { this.platform = platform; return this; } public final Integer getVersion() { return version; } public final void setVersion(Integer version) { this.version = version; } @Override public final Builder version(Integer version) { this.version = version; return this; } @Override public APNSChannelResponse build() { return new APNSChannelResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy