software.amazon.awssdk.services.cognitosync.model.UnsubscribeFromDatasetRequest Maven / Gradle / Ivy
Show all versions of cognitosync Show documentation
/*
* Copyright 2013-2018 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.cognitosync.model;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* A request to UnsubscribeFromDataset.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class UnsubscribeFromDatasetRequest extends CognitoSyncRequest implements
ToCopyableBuilder {
private final String identityPoolId;
private final String identityId;
private final String datasetName;
private final String deviceId;
private UnsubscribeFromDatasetRequest(BuilderImpl builder) {
super(builder);
this.identityPoolId = builder.identityPoolId;
this.identityId = builder.identityId;
this.datasetName = builder.datasetName;
this.deviceId = builder.deviceId;
}
/**
*
* A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The
* ID of the pool to which this identity belongs.
*
*
* @return A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon
* Cognito. The ID of the pool to which this identity belongs.
*/
public String identityPoolId() {
return identityPoolId;
}
/**
*
* Unique ID for this identity.
*
*
* @return Unique ID for this identity.
*/
public String identityId() {
return identityId;
}
/**
*
* The name of the dataset from which to unsubcribe.
*
*
* @return The name of the dataset from which to unsubcribe.
*/
public String datasetName() {
return datasetName;
}
/**
*
* The unique ID generated for this device by Cognito.
*
*
* @return The unique ID generated for this device by Cognito.
*/
public String deviceId() {
return deviceId;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(identityPoolId());
hashCode = 31 * hashCode + Objects.hashCode(identityId());
hashCode = 31 * hashCode + Objects.hashCode(datasetName());
hashCode = 31 * hashCode + Objects.hashCode(deviceId());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UnsubscribeFromDatasetRequest)) {
return false;
}
UnsubscribeFromDatasetRequest other = (UnsubscribeFromDatasetRequest) obj;
return Objects.equals(identityPoolId(), other.identityPoolId()) && Objects.equals(identityId(), other.identityId())
&& Objects.equals(datasetName(), other.datasetName()) && Objects.equals(deviceId(), other.deviceId());
}
@Override
public String toString() {
return ToString.builder("UnsubscribeFromDatasetRequest").add("IdentityPoolId", identityPoolId())
.add("IdentityId", identityId()).add("DatasetName", datasetName()).add("DeviceId", deviceId()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "IdentityPoolId":
return Optional.ofNullable(clazz.cast(identityPoolId()));
case "IdentityId":
return Optional.ofNullable(clazz.cast(identityId()));
case "DatasetName":
return Optional.ofNullable(clazz.cast(datasetName()));
case "DeviceId":
return Optional.ofNullable(clazz.cast(deviceId()));
default:
return Optional.empty();
}
}
public interface Builder extends CognitoSyncRequest.Builder, CopyableBuilder {
/**
*
* A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito.
* The ID of the pool to which this identity belongs.
*
*
* @param identityPoolId
* A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon
* Cognito. The ID of the pool to which this identity belongs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder identityPoolId(String identityPoolId);
/**
*
* Unique ID for this identity.
*
*
* @param identityId
* Unique ID for this identity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder identityId(String identityId);
/**
*
* The name of the dataset from which to unsubcribe.
*
*
* @param datasetName
* The name of the dataset from which to unsubcribe.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder datasetName(String datasetName);
/**
*
* The unique ID generated for this device by Cognito.
*
*
* @param deviceId
* The unique ID generated for this device by Cognito.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder deviceId(String deviceId);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends CognitoSyncRequest.BuilderImpl implements Builder {
private String identityPoolId;
private String identityId;
private String datasetName;
private String deviceId;
private BuilderImpl() {
}
private BuilderImpl(UnsubscribeFromDatasetRequest model) {
super(model);
identityPoolId(model.identityPoolId);
identityId(model.identityId);
datasetName(model.datasetName);
deviceId(model.deviceId);
}
public final String getIdentityPoolId() {
return identityPoolId;
}
@Override
public final Builder identityPoolId(String identityPoolId) {
this.identityPoolId = identityPoolId;
return this;
}
public final void setIdentityPoolId(String identityPoolId) {
this.identityPoolId = identityPoolId;
}
public final String getIdentityId() {
return identityId;
}
@Override
public final Builder identityId(String identityId) {
this.identityId = identityId;
return this;
}
public final void setIdentityId(String identityId) {
this.identityId = identityId;
}
public final String getDatasetName() {
return datasetName;
}
@Override
public final Builder datasetName(String datasetName) {
this.datasetName = datasetName;
return this;
}
public final void setDatasetName(String datasetName) {
this.datasetName = datasetName;
}
public final String getDeviceId() {
return deviceId;
}
@Override
public final Builder deviceId(String deviceId) {
this.deviceId = deviceId;
return this;
}
public final void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public UnsubscribeFromDatasetRequest build() {
return new UnsubscribeFromDatasetRequest(this);
}
}
}