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

software.amazon.awssdk.services.workspaces.model.DescribeApplicationsRequest Maven / Gradle / Ivy

/*
 * 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.workspaces.model;

import java.util.Arrays;
import java.util.Collection;
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.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class DescribeApplicationsRequest extends WorkSpacesRequest implements
        ToCopyableBuilder {
    private static final SdkField> APPLICATION_IDS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("ApplicationIds")
            .getter(getter(DescribeApplicationsRequest::applicationIds))
            .setter(setter(Builder::applicationIds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationIds").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField> COMPUTE_TYPE_NAMES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("ComputeTypeNames")
            .getter(getter(DescribeApplicationsRequest::computeTypeNamesAsStrings))
            .setter(setter(Builder::computeTypeNamesWithStrings))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ComputeTypeNames").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField LICENSE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("LicenseType").getter(getter(DescribeApplicationsRequest::licenseTypeAsString))
            .setter(setter(Builder::licenseType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LicenseType").build()).build();

    private static final SdkField> OPERATING_SYSTEM_NAMES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("OperatingSystemNames")
            .getter(getter(DescribeApplicationsRequest::operatingSystemNamesAsStrings))
            .setter(setter(Builder::operatingSystemNamesWithStrings))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OperatingSystemNames").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField OWNER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Owner")
            .getter(getter(DescribeApplicationsRequest::owner)).setter(setter(Builder::owner))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Owner").build()).build();

    private static final SdkField MAX_RESULTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("MaxResults").getter(getter(DescribeApplicationsRequest::maxResults)).setter(setter(Builder::maxResults))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxResults").build()).build();

    private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("NextToken").getter(getter(DescribeApplicationsRequest::nextToken)).setter(setter(Builder::nextToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextToken").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APPLICATION_IDS_FIELD,
            COMPUTE_TYPE_NAMES_FIELD, LICENSE_TYPE_FIELD, OPERATING_SYSTEM_NAMES_FIELD, OWNER_FIELD, MAX_RESULTS_FIELD,
            NEXT_TOKEN_FIELD));

    private final List applicationIds;

    private final List computeTypeNames;

    private final String licenseType;

    private final List operatingSystemNames;

    private final String owner;

    private final Integer maxResults;

    private final String nextToken;

    private DescribeApplicationsRequest(BuilderImpl builder) {
        super(builder);
        this.applicationIds = builder.applicationIds;
        this.computeTypeNames = builder.computeTypeNames;
        this.licenseType = builder.licenseType;
        this.operatingSystemNames = builder.operatingSystemNames;
        this.owner = builder.owner;
        this.maxResults = builder.maxResults;
        this.nextToken = builder.nextToken;
    }

    /**
     * For responses, this returns true if the service returned a value for the ApplicationIds property. This DOES NOT
     * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
     * This is useful because the SDK will never return a null collection or map, but you may need to differentiate
     * between the service returning nothing (or null) and the service returning an empty collection or map. For
     * requests, this returns true if a value for the property was specified in the request builder, and false if a
     * value was not specified.
     */
    public final boolean hasApplicationIds() {
        return applicationIds != null && !(applicationIds instanceof SdkAutoConstructList);
    }

    /**
     * 

* The identifiers of one or more applications. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasApplicationIds} method. *

* * @return The identifiers of one or more applications. */ public final List applicationIds() { return applicationIds; } /** *

* The compute types supported by the applications. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasComputeTypeNames} method. *

* * @return The compute types supported by the applications. */ public final List computeTypeNames() { return ComputeListCopier.copyStringToEnum(computeTypeNames); } /** * For responses, this returns true if the service returned a value for the ComputeTypeNames property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasComputeTypeNames() { return computeTypeNames != null && !(computeTypeNames instanceof SdkAutoConstructList); } /** *

* The compute types supported by the applications. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasComputeTypeNames} method. *

* * @return The compute types supported by the applications. */ public final List computeTypeNamesAsStrings() { return computeTypeNames; } /** *

* The license availability for the applications. *

*

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

* * @return The license availability for the applications. * @see WorkSpaceApplicationLicenseType */ public final WorkSpaceApplicationLicenseType licenseType() { return WorkSpaceApplicationLicenseType.fromValue(licenseType); } /** *

* The license availability for the applications. *

*

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

* * @return The license availability for the applications. * @see WorkSpaceApplicationLicenseType */ public final String licenseTypeAsString() { return licenseType; } /** *

* The operating systems supported by the applications. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasOperatingSystemNames} method. *

* * @return The operating systems supported by the applications. */ public final List operatingSystemNames() { return OperatingSystemNameListCopier.copyStringToEnum(operatingSystemNames); } /** * For responses, this returns true if the service returned a value for the OperatingSystemNames property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasOperatingSystemNames() { return operatingSystemNames != null && !(operatingSystemNames instanceof SdkAutoConstructList); } /** *

* The operating systems supported by the applications. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasOperatingSystemNames} method. *

* * @return The operating systems supported by the applications. */ public final List operatingSystemNamesAsStrings() { return operatingSystemNames; } /** *

* The owner of the applications. *

* * @return The owner of the applications. */ public final String owner() { return owner; } /** *

* The maximum number of applications to return. *

* * @return The maximum number of applications to return. */ public final Integer maxResults() { return maxResults; } /** *

* If you received a NextToken from a previous call that was paginated, provide this token to receive * the next set of results. *

* * @return If you received a NextToken from a previous call that was paginated, provide this token to * receive the next set of results. */ public final String nextToken() { return nextToken; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(hasApplicationIds() ? applicationIds() : null); hashCode = 31 * hashCode + Objects.hashCode(hasComputeTypeNames() ? computeTypeNamesAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(licenseTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasOperatingSystemNames() ? operatingSystemNamesAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(owner()); hashCode = 31 * hashCode + Objects.hashCode(maxResults()); hashCode = 31 * hashCode + Objects.hashCode(nextToken()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DescribeApplicationsRequest)) { return false; } DescribeApplicationsRequest other = (DescribeApplicationsRequest) obj; return hasApplicationIds() == other.hasApplicationIds() && Objects.equals(applicationIds(), other.applicationIds()) && hasComputeTypeNames() == other.hasComputeTypeNames() && Objects.equals(computeTypeNamesAsStrings(), other.computeTypeNamesAsStrings()) && Objects.equals(licenseTypeAsString(), other.licenseTypeAsString()) && hasOperatingSystemNames() == other.hasOperatingSystemNames() && Objects.equals(operatingSystemNamesAsStrings(), other.operatingSystemNamesAsStrings()) && Objects.equals(owner(), other.owner()) && Objects.equals(maxResults(), other.maxResults()) && Objects.equals(nextToken(), other.nextToken()); } /** * 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("DescribeApplicationsRequest") .add("ApplicationIds", hasApplicationIds() ? applicationIds() : null) .add("ComputeTypeNames", hasComputeTypeNames() ? computeTypeNamesAsStrings() : null) .add("LicenseType", licenseTypeAsString()) .add("OperatingSystemNames", hasOperatingSystemNames() ? operatingSystemNamesAsStrings() : null) .add("Owner", owner()).add("MaxResults", maxResults()).add("NextToken", nextToken()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ApplicationIds": return Optional.ofNullable(clazz.cast(applicationIds())); case "ComputeTypeNames": return Optional.ofNullable(clazz.cast(computeTypeNamesAsStrings())); case "LicenseType": return Optional.ofNullable(clazz.cast(licenseTypeAsString())); case "OperatingSystemNames": return Optional.ofNullable(clazz.cast(operatingSystemNamesAsStrings())); case "Owner": return Optional.ofNullable(clazz.cast(owner())); case "MaxResults": return Optional.ofNullable(clazz.cast(maxResults())); case "NextToken": return Optional.ofNullable(clazz.cast(nextToken())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeApplicationsRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends WorkSpacesRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The identifiers of one or more applications. *

* * @param applicationIds * The identifiers of one or more applications. * @return Returns a reference to this object so that method calls can be chained together. */ Builder applicationIds(Collection applicationIds); /** *

* The identifiers of one or more applications. *

* * @param applicationIds * The identifiers of one or more applications. * @return Returns a reference to this object so that method calls can be chained together. */ Builder applicationIds(String... applicationIds); /** *

* The compute types supported by the applications. *

* * @param computeTypeNames * The compute types supported by the applications. * @return Returns a reference to this object so that method calls can be chained together. */ Builder computeTypeNamesWithStrings(Collection computeTypeNames); /** *

* The compute types supported by the applications. *

* * @param computeTypeNames * The compute types supported by the applications. * @return Returns a reference to this object so that method calls can be chained together. */ Builder computeTypeNamesWithStrings(String... computeTypeNames); /** *

* The compute types supported by the applications. *

* * @param computeTypeNames * The compute types supported by the applications. * @return Returns a reference to this object so that method calls can be chained together. */ Builder computeTypeNames(Collection computeTypeNames); /** *

* The compute types supported by the applications. *

* * @param computeTypeNames * The compute types supported by the applications. * @return Returns a reference to this object so that method calls can be chained together. */ Builder computeTypeNames(Compute... computeTypeNames); /** *

* The license availability for the applications. *

* * @param licenseType * The license availability for the applications. * @see WorkSpaceApplicationLicenseType * @return Returns a reference to this object so that method calls can be chained together. * @see WorkSpaceApplicationLicenseType */ Builder licenseType(String licenseType); /** *

* The license availability for the applications. *

* * @param licenseType * The license availability for the applications. * @see WorkSpaceApplicationLicenseType * @return Returns a reference to this object so that method calls can be chained together. * @see WorkSpaceApplicationLicenseType */ Builder licenseType(WorkSpaceApplicationLicenseType licenseType); /** *

* The operating systems supported by the applications. *

* * @param operatingSystemNames * The operating systems supported by the applications. * @return Returns a reference to this object so that method calls can be chained together. */ Builder operatingSystemNamesWithStrings(Collection operatingSystemNames); /** *

* The operating systems supported by the applications. *

* * @param operatingSystemNames * The operating systems supported by the applications. * @return Returns a reference to this object so that method calls can be chained together. */ Builder operatingSystemNamesWithStrings(String... operatingSystemNames); /** *

* The operating systems supported by the applications. *

* * @param operatingSystemNames * The operating systems supported by the applications. * @return Returns a reference to this object so that method calls can be chained together. */ Builder operatingSystemNames(Collection operatingSystemNames); /** *

* The operating systems supported by the applications. *

* * @param operatingSystemNames * The operating systems supported by the applications. * @return Returns a reference to this object so that method calls can be chained together. */ Builder operatingSystemNames(OperatingSystemName... operatingSystemNames); /** *

* The owner of the applications. *

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

* The maximum number of applications to return. *

* * @param maxResults * The maximum number of applications to return. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxResults(Integer maxResults); /** *

* If you received a NextToken from a previous call that was paginated, provide this token to * receive the next set of results. *

* * @param nextToken * If you received a NextToken from a previous call that was paginated, provide this token * to receive the next set of results. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nextToken(String nextToken); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends WorkSpacesRequest.BuilderImpl implements Builder { private List applicationIds = DefaultSdkAutoConstructList.getInstance(); private List computeTypeNames = DefaultSdkAutoConstructList.getInstance(); private String licenseType; private List operatingSystemNames = DefaultSdkAutoConstructList.getInstance(); private String owner; private Integer maxResults; private String nextToken; private BuilderImpl() { } private BuilderImpl(DescribeApplicationsRequest model) { super(model); applicationIds(model.applicationIds); computeTypeNamesWithStrings(model.computeTypeNames); licenseType(model.licenseType); operatingSystemNamesWithStrings(model.operatingSystemNames); owner(model.owner); maxResults(model.maxResults); nextToken(model.nextToken); } public final Collection getApplicationIds() { if (applicationIds instanceof SdkAutoConstructList) { return null; } return applicationIds; } public final void setApplicationIds(Collection applicationIds) { this.applicationIds = WorkSpaceApplicationIdListCopier.copy(applicationIds); } @Override public final Builder applicationIds(Collection applicationIds) { this.applicationIds = WorkSpaceApplicationIdListCopier.copy(applicationIds); return this; } @Override @SafeVarargs public final Builder applicationIds(String... applicationIds) { applicationIds(Arrays.asList(applicationIds)); return this; } public final Collection getComputeTypeNames() { if (computeTypeNames instanceof SdkAutoConstructList) { return null; } return computeTypeNames; } public final void setComputeTypeNames(Collection computeTypeNames) { this.computeTypeNames = ComputeListCopier.copy(computeTypeNames); } @Override public final Builder computeTypeNamesWithStrings(Collection computeTypeNames) { this.computeTypeNames = ComputeListCopier.copy(computeTypeNames); return this; } @Override @SafeVarargs public final Builder computeTypeNamesWithStrings(String... computeTypeNames) { computeTypeNamesWithStrings(Arrays.asList(computeTypeNames)); return this; } @Override public final Builder computeTypeNames(Collection computeTypeNames) { this.computeTypeNames = ComputeListCopier.copyEnumToString(computeTypeNames); return this; } @Override @SafeVarargs public final Builder computeTypeNames(Compute... computeTypeNames) { computeTypeNames(Arrays.asList(computeTypeNames)); return this; } public final String getLicenseType() { return licenseType; } public final void setLicenseType(String licenseType) { this.licenseType = licenseType; } @Override public final Builder licenseType(String licenseType) { this.licenseType = licenseType; return this; } @Override public final Builder licenseType(WorkSpaceApplicationLicenseType licenseType) { this.licenseType(licenseType == null ? null : licenseType.toString()); return this; } public final Collection getOperatingSystemNames() { if (operatingSystemNames instanceof SdkAutoConstructList) { return null; } return operatingSystemNames; } public final void setOperatingSystemNames(Collection operatingSystemNames) { this.operatingSystemNames = OperatingSystemNameListCopier.copy(operatingSystemNames); } @Override public final Builder operatingSystemNamesWithStrings(Collection operatingSystemNames) { this.operatingSystemNames = OperatingSystemNameListCopier.copy(operatingSystemNames); return this; } @Override @SafeVarargs public final Builder operatingSystemNamesWithStrings(String... operatingSystemNames) { operatingSystemNamesWithStrings(Arrays.asList(operatingSystemNames)); return this; } @Override public final Builder operatingSystemNames(Collection operatingSystemNames) { this.operatingSystemNames = OperatingSystemNameListCopier.copyEnumToString(operatingSystemNames); return this; } @Override @SafeVarargs public final Builder operatingSystemNames(OperatingSystemName... operatingSystemNames) { operatingSystemNames(Arrays.asList(operatingSystemNames)); return this; } public final String getOwner() { return owner; } public final void setOwner(String owner) { this.owner = owner; } @Override public final Builder owner(String owner) { this.owner = owner; return this; } public final Integer getMaxResults() { return maxResults; } public final void setMaxResults(Integer maxResults) { this.maxResults = maxResults; } @Override public final Builder maxResults(Integer maxResults) { this.maxResults = maxResults; return this; } public final String getNextToken() { return nextToken; } public final void setNextToken(String nextToken) { this.nextToken = nextToken; } @Override public final Builder nextToken(String nextToken) { this.nextToken = nextToken; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public DescribeApplicationsRequest build() { return new DescribeApplicationsRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy