software.amazon.awssdk.services.pinpoint.model.APNSVoipSandboxChannelRequest Maven / Gradle / Ivy
Show all versions of pinpoint Show documentation
/*
* 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;
/**
*
* Specifies the status and settings of the APNs (Apple Push Notification service) VoIP sandbox channel for an
* application.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class APNSVoipSandboxChannelRequest implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField BUNDLE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BundleId").getter(getter(APNSVoipSandboxChannelRequest::bundleId)).setter(setter(Builder::bundleId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BundleId").build()).build();
private static final SdkField CERTIFICATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Certificate").getter(getter(APNSVoipSandboxChannelRequest::certificate))
.setter(setter(Builder::certificate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Certificate").build()).build();
private static final SdkField DEFAULT_AUTHENTICATION_METHOD_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("DefaultAuthenticationMethod")
.getter(getter(APNSVoipSandboxChannelRequest::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(APNSVoipSandboxChannelRequest::enabled)).setter(setter(Builder::enabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Enabled").build()).build();
private static final SdkField PRIVATE_KEY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("PrivateKey").getter(getter(APNSVoipSandboxChannelRequest::privateKey))
.setter(setter(Builder::privateKey))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PrivateKey").build()).build();
private static final SdkField TEAM_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("TeamId")
.getter(getter(APNSVoipSandboxChannelRequest::teamId)).setter(setter(Builder::teamId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TeamId").build()).build();
private static final SdkField TOKEN_KEY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TokenKey").getter(getter(APNSVoipSandboxChannelRequest::tokenKey)).setter(setter(Builder::tokenKey))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TokenKey").build()).build();
private static final SdkField TOKEN_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TokenKeyId").getter(getter(APNSVoipSandboxChannelRequest::tokenKeyId))
.setter(setter(Builder::tokenKeyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TokenKeyId").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BUNDLE_ID_FIELD,
CERTIFICATE_FIELD, DEFAULT_AUTHENTICATION_METHOD_FIELD, ENABLED_FIELD, PRIVATE_KEY_FIELD, TEAM_ID_FIELD,
TOKEN_KEY_FIELD, TOKEN_KEY_ID_FIELD));
private static final long serialVersionUID = 1L;
private final String bundleId;
private final String certificate;
private final String defaultAuthenticationMethod;
private final Boolean enabled;
private final String privateKey;
private final String teamId;
private final String tokenKey;
private final String tokenKeyId;
private APNSVoipSandboxChannelRequest(BuilderImpl builder) {
this.bundleId = builder.bundleId;
this.certificate = builder.certificate;
this.defaultAuthenticationMethod = builder.defaultAuthenticationMethod;
this.enabled = builder.enabled;
this.privateKey = builder.privateKey;
this.teamId = builder.teamId;
this.tokenKey = builder.tokenKey;
this.tokenKeyId = builder.tokenKeyId;
}
/**
*
* The bundle identifier that's assigned to your iOS app. This identifier is used for APNs tokens.
*
*
* @return The bundle identifier that's assigned to your iOS app. This identifier is used for APNs tokens.
*/
public final String bundleId() {
return bundleId;
}
/**
*
* The APNs client certificate that you received from Apple, if you want Amazon Pinpoint to communicate with the
* APNs sandbox environment by using an APNs certificate.
*
*
* @return The APNs client certificate that you received from Apple, if you want Amazon Pinpoint to communicate with
* the APNs sandbox environment by using an APNs certificate.
*/
public final String certificate() {
return certificate;
}
/**
*
* The default authentication method that you want Amazon Pinpoint to use when authenticating with the APNs sandbox
* environment for this channel, key or certificate.
*
*
* @return The default authentication method that you want Amazon Pinpoint to use when authenticating with the APNs
* sandbox environment for this channel, key or certificate.
*/
public final String defaultAuthenticationMethod() {
return defaultAuthenticationMethod;
}
/**
*
* Specifies whether the APNs VoIP sandbox channel is enabled for the application.
*
*
* @return Specifies whether the APNs VoIP sandbox channel is enabled for the application.
*/
public final Boolean enabled() {
return enabled;
}
/**
*
* The private key for the APNs client certificate that you want Amazon Pinpoint to use to communicate with the APNs
* sandbox environment.
*
*
* @return The private key for the APNs client certificate that you want Amazon Pinpoint to use to communicate with
* the APNs sandbox environment.
*/
public final String privateKey() {
return privateKey;
}
/**
*
* The identifier that's assigned to your Apple developer account team. This identifier is used for APNs tokens.
*
*
* @return The identifier that's assigned to your Apple developer account team. This identifier is used for APNs
* tokens.
*/
public final String teamId() {
return teamId;
}
/**
*
* The authentication key to use for APNs tokens.
*
*
* @return The authentication key to use for APNs tokens.
*/
public final String tokenKey() {
return tokenKey;
}
/**
*
* The key identifier that's assigned to your APNs signing key, if you want Amazon Pinpoint to communicate with the
* APNs sandbox environment by using APNs tokens.
*
*
* @return The key identifier that's assigned to your APNs signing key, if you want Amazon Pinpoint to communicate
* with the APNs sandbox environment by using APNs tokens.
*/
public final String tokenKeyId() {
return tokenKeyId;
}
@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 + Objects.hashCode(bundleId());
hashCode = 31 * hashCode + Objects.hashCode(certificate());
hashCode = 31 * hashCode + Objects.hashCode(defaultAuthenticationMethod());
hashCode = 31 * hashCode + Objects.hashCode(enabled());
hashCode = 31 * hashCode + Objects.hashCode(privateKey());
hashCode = 31 * hashCode + Objects.hashCode(teamId());
hashCode = 31 * hashCode + Objects.hashCode(tokenKey());
hashCode = 31 * hashCode + Objects.hashCode(tokenKeyId());
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 APNSVoipSandboxChannelRequest)) {
return false;
}
APNSVoipSandboxChannelRequest other = (APNSVoipSandboxChannelRequest) obj;
return Objects.equals(bundleId(), other.bundleId()) && Objects.equals(certificate(), other.certificate())
&& Objects.equals(defaultAuthenticationMethod(), other.defaultAuthenticationMethod())
&& Objects.equals(enabled(), other.enabled()) && Objects.equals(privateKey(), other.privateKey())
&& Objects.equals(teamId(), other.teamId()) && Objects.equals(tokenKey(), other.tokenKey())
&& Objects.equals(tokenKeyId(), other.tokenKeyId());
}
/**
* 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("APNSVoipSandboxChannelRequest").add("BundleId", bundleId()).add("Certificate", certificate())
.add("DefaultAuthenticationMethod", defaultAuthenticationMethod()).add("Enabled", enabled())
.add("PrivateKey", privateKey()).add("TeamId", teamId()).add("TokenKey", tokenKey())
.add("TokenKeyId", tokenKeyId()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "BundleId":
return Optional.ofNullable(clazz.cast(bundleId()));
case "Certificate":
return Optional.ofNullable(clazz.cast(certificate()));
case "DefaultAuthenticationMethod":
return Optional.ofNullable(clazz.cast(defaultAuthenticationMethod()));
case "Enabled":
return Optional.ofNullable(clazz.cast(enabled()));
case "PrivateKey":
return Optional.ofNullable(clazz.cast(privateKey()));
case "TeamId":
return Optional.ofNullable(clazz.cast(teamId()));
case "TokenKey":
return Optional.ofNullable(clazz.cast(tokenKey()));
case "TokenKeyId":
return Optional.ofNullable(clazz.cast(tokenKeyId()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function