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

software.amazon.awssdk.services.iot.model.PackageVersionSummary Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.30.1
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.iot.model;

import java.io.Serializable;
import java.time.Instant;
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.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;

/**
 * 

* A summary of information about a package version. *

*/ @Generated("software.amazon.awssdk:codegen") public final class PackageVersionSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField PACKAGE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("packageName").getter(getter(PackageVersionSummary::packageName)).setter(setter(Builder::packageName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("packageName").build()).build(); private static final SdkField VERSION_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("versionName").getter(getter(PackageVersionSummary::versionName)).setter(setter(Builder::versionName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("versionName").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(PackageVersionSummary::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField CREATION_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("creationDate").getter(getter(PackageVersionSummary::creationDate)).setter(setter(Builder::creationDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationDate").build()).build(); private static final SdkField LAST_MODIFIED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("lastModifiedDate").getter(getter(PackageVersionSummary::lastModifiedDate)) .setter(setter(Builder::lastModifiedDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastModifiedDate").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PACKAGE_NAME_FIELD, VERSION_NAME_FIELD, STATUS_FIELD, CREATION_DATE_FIELD, LAST_MODIFIED_DATE_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String packageName; private final String versionName; private final String status; private final Instant creationDate; private final Instant lastModifiedDate; private PackageVersionSummary(BuilderImpl builder) { this.packageName = builder.packageName; this.versionName = builder.versionName; this.status = builder.status; this.creationDate = builder.creationDate; this.lastModifiedDate = builder.lastModifiedDate; } /** *

* The name of the associated software package. *

* * @return The name of the associated software package. */ public final String packageName() { return packageName; } /** *

* The name of the target package version. *

* * @return The name of the target package version. */ public final String versionName() { return versionName; } /** *

* The status of the package version. For more information, see Package version lifecycle. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link PackageVersionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

* * @return The status of the package version. For more information, see Package version lifecycle. * @see PackageVersionStatus */ public final PackageVersionStatus status() { return PackageVersionStatus.fromValue(status); } /** *

* The status of the package version. For more information, see Package version lifecycle. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link PackageVersionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

* * @return The status of the package version. For more information, see Package version lifecycle. * @see PackageVersionStatus */ public final String statusAsString() { return status; } /** *

* The date that the package version was created. *

* * @return The date that the package version was created. */ public final Instant creationDate() { return creationDate; } /** *

* The date that the package version was last updated. *

* * @return The date that the package version was last updated. */ public final Instant lastModifiedDate() { return lastModifiedDate; } @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(packageName()); hashCode = 31 * hashCode + Objects.hashCode(versionName()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(creationDate()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedDate()); 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 PackageVersionSummary)) { return false; } PackageVersionSummary other = (PackageVersionSummary) obj; return Objects.equals(packageName(), other.packageName()) && Objects.equals(versionName(), other.versionName()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(creationDate(), other.creationDate()) && Objects.equals(lastModifiedDate(), other.lastModifiedDate()); } /** * 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("PackageVersionSummary").add("PackageName", packageName()).add("VersionName", versionName()) .add("Status", statusAsString()).add("CreationDate", creationDate()).add("LastModifiedDate", lastModifiedDate()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "packageName": return Optional.ofNullable(clazz.cast(packageName())); case "versionName": return Optional.ofNullable(clazz.cast(versionName())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "creationDate": return Optional.ofNullable(clazz.cast(creationDate())); case "lastModifiedDate": return Optional.ofNullable(clazz.cast(lastModifiedDate())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("packageName", PACKAGE_NAME_FIELD); map.put("versionName", VERSION_NAME_FIELD); map.put("status", STATUS_FIELD); map.put("creationDate", CREATION_DATE_FIELD); map.put("lastModifiedDate", LAST_MODIFIED_DATE_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((PackageVersionSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the associated software package. *

* * @param packageName * The name of the associated software package. * @return Returns a reference to this object so that method calls can be chained together. */ Builder packageName(String packageName); /** *

* The name of the target package version. *

* * @param versionName * The name of the target package version. * @return Returns a reference to this object so that method calls can be chained together. */ Builder versionName(String versionName); /** *

* The status of the package version. For more information, see Package version lifecycle. *

* * @param status * The status of the package version. For more information, see Package version lifecycle. * @see PackageVersionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see PackageVersionStatus */ Builder status(String status); /** *

* The status of the package version. For more information, see Package version lifecycle. *

* * @param status * The status of the package version. For more information, see Package version lifecycle. * @see PackageVersionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see PackageVersionStatus */ Builder status(PackageVersionStatus status); /** *

* The date that the package version was created. *

* * @param creationDate * The date that the package version was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationDate(Instant creationDate); /** *

* The date that the package version was last updated. *

* * @param lastModifiedDate * The date that the package version was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedDate(Instant lastModifiedDate); } static final class BuilderImpl implements Builder { private String packageName; private String versionName; private String status; private Instant creationDate; private Instant lastModifiedDate; private BuilderImpl() { } private BuilderImpl(PackageVersionSummary model) { packageName(model.packageName); versionName(model.versionName); status(model.status); creationDate(model.creationDate); lastModifiedDate(model.lastModifiedDate); } public final String getPackageName() { return packageName; } public final void setPackageName(String packageName) { this.packageName = packageName; } @Override public final Builder packageName(String packageName) { this.packageName = packageName; return this; } public final String getVersionName() { return versionName; } public final void setVersionName(String versionName) { this.versionName = versionName; } @Override public final Builder versionName(String versionName) { this.versionName = versionName; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(PackageVersionStatus status) { this.status(status == null ? null : status.toString()); return this; } public final Instant getCreationDate() { return creationDate; } public final void setCreationDate(Instant creationDate) { this.creationDate = creationDate; } @Override public final Builder creationDate(Instant creationDate) { this.creationDate = creationDate; return this; } public final Instant getLastModifiedDate() { return lastModifiedDate; } public final void setLastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } @Override public final Builder lastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; return this; } @Override public PackageVersionSummary build() { return new PackageVersionSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy