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

software.amazon.awssdk.services.iotsitewise.model.ActionSummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Io T Site Wise module holds the client classes that are used for communicating with Io T Site Wise.

The 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.iotsitewise.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
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.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;

/**
 * 

* Contains the summary of the actions. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ActionSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ACTION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("actionId").getter(getter(ActionSummary::actionId)).setter(setter(Builder::actionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("actionId").build()).build(); private static final SdkField ACTION_DEFINITION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("actionDefinitionId").getter(getter(ActionSummary::actionDefinitionId)) .setter(setter(Builder::actionDefinitionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("actionDefinitionId").build()) .build(); private static final SdkField TARGET_RESOURCE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("targetResource") .getter(getter(ActionSummary::targetResource)).setter(setter(Builder::targetResource)) .constructor(TargetResource::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("targetResource").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACTION_ID_FIELD, ACTION_DEFINITION_ID_FIELD, TARGET_RESOURCE_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("actionId", ACTION_ID_FIELD); put("actionDefinitionId", ACTION_DEFINITION_ID_FIELD); put("targetResource", TARGET_RESOURCE_FIELD); } }); private static final long serialVersionUID = 1L; private final String actionId; private final String actionDefinitionId; private final TargetResource targetResource; private ActionSummary(BuilderImpl builder) { this.actionId = builder.actionId; this.actionDefinitionId = builder.actionDefinitionId; this.targetResource = builder.targetResource; } /** *

* The ID of the action. *

* * @return The ID of the action. */ public final String actionId() { return actionId; } /** *

* The ID of the action definition. *

* * @return The ID of the action definition. */ public final String actionDefinitionId() { return actionDefinitionId; } /** *

* The resource the action will be taken on. *

* * @return The resource the action will be taken on. */ public final TargetResource targetResource() { return targetResource; } @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(actionId()); hashCode = 31 * hashCode + Objects.hashCode(actionDefinitionId()); hashCode = 31 * hashCode + Objects.hashCode(targetResource()); 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 ActionSummary)) { return false; } ActionSummary other = (ActionSummary) obj; return Objects.equals(actionId(), other.actionId()) && Objects.equals(actionDefinitionId(), other.actionDefinitionId()) && Objects.equals(targetResource(), other.targetResource()); } /** * 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("ActionSummary").add("ActionId", actionId()).add("ActionDefinitionId", actionDefinitionId()) .add("TargetResource", targetResource()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "actionId": return Optional.ofNullable(clazz.cast(actionId())); case "actionDefinitionId": return Optional.ofNullable(clazz.cast(actionDefinitionId())); case "targetResource": return Optional.ofNullable(clazz.cast(targetResource())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((ActionSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID of the action. *

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

* The ID of the action definition. *

* * @param actionDefinitionId * The ID of the action definition. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actionDefinitionId(String actionDefinitionId); /** *

* The resource the action will be taken on. *

* * @param targetResource * The resource the action will be taken on. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetResource(TargetResource targetResource); /** *

* The resource the action will be taken on. *

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

* When the {@link Consumer} completes, {@link TargetResource.Builder#build()} is called immediately and its * result is passed to {@link #targetResource(TargetResource)}. * * @param targetResource * a consumer that will call methods on {@link TargetResource.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #targetResource(TargetResource) */ default Builder targetResource(Consumer targetResource) { return targetResource(TargetResource.builder().applyMutation(targetResource).build()); } } static final class BuilderImpl implements Builder { private String actionId; private String actionDefinitionId; private TargetResource targetResource; private BuilderImpl() { } private BuilderImpl(ActionSummary model) { actionId(model.actionId); actionDefinitionId(model.actionDefinitionId); targetResource(model.targetResource); } public final String getActionId() { return actionId; } public final void setActionId(String actionId) { this.actionId = actionId; } @Override public final Builder actionId(String actionId) { this.actionId = actionId; return this; } public final String getActionDefinitionId() { return actionDefinitionId; } public final void setActionDefinitionId(String actionDefinitionId) { this.actionDefinitionId = actionDefinitionId; } @Override public final Builder actionDefinitionId(String actionDefinitionId) { this.actionDefinitionId = actionDefinitionId; return this; } public final TargetResource.Builder getTargetResource() { return targetResource != null ? targetResource.toBuilder() : null; } public final void setTargetResource(TargetResource.BuilderImpl targetResource) { this.targetResource = targetResource != null ? targetResource.build() : null; } @Override public final Builder targetResource(TargetResource targetResource) { this.targetResource = targetResource; return this; } @Override public ActionSummary build() { return new ActionSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy