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

software.amazon.awssdk.services.worklink.model.FleetSummary Maven / Gradle / Ivy

/*
 * Copyright 2014-2019 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.worklink.model;

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

/**
 * 

* The summary of the fleet. *

*/ @Generated("software.amazon.awssdk:codegen") public final class FleetSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField FLEET_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(FleetSummary::fleetArn)).setter(setter(Builder::fleetArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FleetArn").build()).build(); private static final SdkField CREATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .getter(getter(FleetSummary::createdTime)).setter(setter(Builder::createdTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedTime").build()).build(); private static final SdkField LAST_UPDATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .getter(getter(FleetSummary::lastUpdatedTime)).setter(setter(Builder::lastUpdatedTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdatedTime").build()).build(); private static final SdkField FLEET_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(FleetSummary::fleetName)).setter(setter(Builder::fleetName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FleetName").build()).build(); private static final SdkField DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(FleetSummary::displayName)).setter(setter(Builder::displayName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisplayName").build()).build(); private static final SdkField COMPANY_CODE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(FleetSummary::companyCode)).setter(setter(Builder::companyCode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompanyCode").build()).build(); private static final SdkField FLEET_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(FleetSummary::fleetStatusAsString)).setter(setter(Builder::fleetStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FleetStatus").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FLEET_ARN_FIELD, CREATED_TIME_FIELD, LAST_UPDATED_TIME_FIELD, FLEET_NAME_FIELD, DISPLAY_NAME_FIELD, COMPANY_CODE_FIELD, FLEET_STATUS_FIELD)); private static final long serialVersionUID = 1L; private final String fleetArn; private final Instant createdTime; private final Instant lastUpdatedTime; private final String fleetName; private final String displayName; private final String companyCode; private final String fleetStatus; private FleetSummary(BuilderImpl builder) { this.fleetArn = builder.fleetArn; this.createdTime = builder.createdTime; this.lastUpdatedTime = builder.lastUpdatedTime; this.fleetName = builder.fleetName; this.displayName = builder.displayName; this.companyCode = builder.companyCode; this.fleetStatus = builder.fleetStatus; } /** *

* The ARN of the fleet. *

* * @return The ARN of the fleet. */ public String fleetArn() { return fleetArn; } /** *

* The time when the fleet was created. *

* * @return The time when the fleet was created. */ public Instant createdTime() { return createdTime; } /** *

* The time when the fleet was last updated. *

* * @return The time when the fleet was last updated. */ public Instant lastUpdatedTime() { return lastUpdatedTime; } /** *

* The name of the fleet. *

* * @return The name of the fleet. */ public String fleetName() { return fleetName; } /** *

* The name to display. *

* * @return The name to display. */ public String displayName() { return displayName; } /** *

* The identifier used by users to sign into the Amazon WorkLink app. *

* * @return The identifier used by users to sign into the Amazon WorkLink app. */ public String companyCode() { return companyCode; } /** *

* The status of the fleet. *

*

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

* * @return The status of the fleet. * @see FleetStatus */ public FleetStatus fleetStatus() { return FleetStatus.fromValue(fleetStatus); } /** *

* The status of the fleet. *

*

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

* * @return The status of the fleet. * @see FleetStatus */ public String fleetStatusAsString() { return fleetStatus; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(fleetArn()); hashCode = 31 * hashCode + Objects.hashCode(createdTime()); hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedTime()); hashCode = 31 * hashCode + Objects.hashCode(fleetName()); hashCode = 31 * hashCode + Objects.hashCode(displayName()); hashCode = 31 * hashCode + Objects.hashCode(companyCode()); hashCode = 31 * hashCode + Objects.hashCode(fleetStatusAsString()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof FleetSummary)) { return false; } FleetSummary other = (FleetSummary) obj; return Objects.equals(fleetArn(), other.fleetArn()) && Objects.equals(createdTime(), other.createdTime()) && Objects.equals(lastUpdatedTime(), other.lastUpdatedTime()) && Objects.equals(fleetName(), other.fleetName()) && Objects.equals(displayName(), other.displayName()) && Objects.equals(companyCode(), other.companyCode()) && Objects.equals(fleetStatusAsString(), other.fleetStatusAsString()); } /** * 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 String toString() { return ToString.builder("FleetSummary").add("FleetArn", fleetArn()).add("CreatedTime", createdTime()) .add("LastUpdatedTime", lastUpdatedTime()).add("FleetName", fleetName()).add("DisplayName", displayName()) .add("CompanyCode", companyCode()).add("FleetStatus", fleetStatusAsString()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "FleetArn": return Optional.ofNullable(clazz.cast(fleetArn())); case "CreatedTime": return Optional.ofNullable(clazz.cast(createdTime())); case "LastUpdatedTime": return Optional.ofNullable(clazz.cast(lastUpdatedTime())); case "FleetName": return Optional.ofNullable(clazz.cast(fleetName())); case "DisplayName": return Optional.ofNullable(clazz.cast(displayName())); case "CompanyCode": return Optional.ofNullable(clazz.cast(companyCode())); case "FleetStatus": return Optional.ofNullable(clazz.cast(fleetStatusAsString())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((FleetSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ARN of the fleet. *

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

* The time when the fleet was created. *

* * @param createdTime * The time when the fleet was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdTime(Instant createdTime); /** *

* The time when the fleet was last updated. *

* * @param lastUpdatedTime * The time when the fleet was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastUpdatedTime(Instant lastUpdatedTime); /** *

* The name of the fleet. *

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

* The name to display. *

* * @param displayName * The name to display. * @return Returns a reference to this object so that method calls can be chained together. */ Builder displayName(String displayName); /** *

* The identifier used by users to sign into the Amazon WorkLink app. *

* * @param companyCode * The identifier used by users to sign into the Amazon WorkLink app. * @return Returns a reference to this object so that method calls can be chained together. */ Builder companyCode(String companyCode); /** *

* The status of the fleet. *

* * @param fleetStatus * The status of the fleet. * @see FleetStatus * @return Returns a reference to this object so that method calls can be chained together. * @see FleetStatus */ Builder fleetStatus(String fleetStatus); /** *

* The status of the fleet. *

* * @param fleetStatus * The status of the fleet. * @see FleetStatus * @return Returns a reference to this object so that method calls can be chained together. * @see FleetStatus */ Builder fleetStatus(FleetStatus fleetStatus); } static final class BuilderImpl implements Builder { private String fleetArn; private Instant createdTime; private Instant lastUpdatedTime; private String fleetName; private String displayName; private String companyCode; private String fleetStatus; private BuilderImpl() { } private BuilderImpl(FleetSummary model) { fleetArn(model.fleetArn); createdTime(model.createdTime); lastUpdatedTime(model.lastUpdatedTime); fleetName(model.fleetName); displayName(model.displayName); companyCode(model.companyCode); fleetStatus(model.fleetStatus); } public final String getFleetArn() { return fleetArn; } @Override public final Builder fleetArn(String fleetArn) { this.fleetArn = fleetArn; return this; } public final void setFleetArn(String fleetArn) { this.fleetArn = fleetArn; } public final Instant getCreatedTime() { return createdTime; } @Override public final Builder createdTime(Instant createdTime) { this.createdTime = createdTime; return this; } public final void setCreatedTime(Instant createdTime) { this.createdTime = createdTime; } public final Instant getLastUpdatedTime() { return lastUpdatedTime; } @Override public final Builder lastUpdatedTime(Instant lastUpdatedTime) { this.lastUpdatedTime = lastUpdatedTime; return this; } public final void setLastUpdatedTime(Instant lastUpdatedTime) { this.lastUpdatedTime = lastUpdatedTime; } public final String getFleetName() { return fleetName; } @Override public final Builder fleetName(String fleetName) { this.fleetName = fleetName; return this; } public final void setFleetName(String fleetName) { this.fleetName = fleetName; } public final String getDisplayName() { return displayName; } @Override public final Builder displayName(String displayName) { this.displayName = displayName; return this; } public final void setDisplayName(String displayName) { this.displayName = displayName; } public final String getCompanyCode() { return companyCode; } @Override public final Builder companyCode(String companyCode) { this.companyCode = companyCode; return this; } public final void setCompanyCode(String companyCode) { this.companyCode = companyCode; } public final String getFleetStatusAsString() { return fleetStatus; } @Override public final Builder fleetStatus(String fleetStatus) { this.fleetStatus = fleetStatus; return this; } @Override public final Builder fleetStatus(FleetStatus fleetStatus) { this.fleetStatus(fleetStatus == null ? null : fleetStatus.toString()); return this; } public final void setFleetStatus(String fleetStatus) { this.fleetStatus = fleetStatus; } @Override public FleetSummary build() { return new FleetSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy