
software.amazon.awssdk.services.cognitosync.model.GetCognitoEventsResponse Maven / Gradle / Ivy
/*
* 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.Map;
import java.util.Objects;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The response from the GetCognitoEvents request
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetCognitoEventsResponse extends CognitoSyncResponse implements
ToCopyableBuilder {
private final Map events;
private GetCognitoEventsResponse(BuilderImpl builder) {
super(builder);
this.events = builder.events;
}
/**
*
* The Cognito Events returned from the GetCognitoEvents request
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The Cognito Events returned from the GetCognitoEvents request
*/
public Map events() {
return events;
}
@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(events());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetCognitoEventsResponse)) {
return false;
}
GetCognitoEventsResponse other = (GetCognitoEventsResponse) obj;
return Objects.equals(events(), other.events());
}
@Override
public String toString() {
return ToString.builder("GetCognitoEventsResponse").add("Events", events()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Events":
return Optional.ofNullable(clazz.cast(events()));
default:
return Optional.empty();
}
}
public interface Builder extends CognitoSyncResponse.Builder, CopyableBuilder {
/**
*
* The Cognito Events returned from the GetCognitoEvents request
*
*
* @param events
* The Cognito Events returned from the GetCognitoEvents request
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder events(Map events);
}
static final class BuilderImpl extends CognitoSyncResponse.BuilderImpl implements Builder {
private Map events = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(GetCognitoEventsResponse model) {
super(model);
events(model.events);
}
public final Map getEvents() {
return events;
}
@Override
public final Builder events(Map events) {
this.events = EventsCopier.copy(events);
return this;
}
public final void setEvents(Map events) {
this.events = EventsCopier.copy(events);
}
@Override
public GetCognitoEventsResponse build() {
return new GetCognitoEventsResponse(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy