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

software.amazon.awssdk.services.cloudformation.model.DeploymentTargets Maven / Gradle / Ivy

Go to download

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

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

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

/**
 * 

* [Service-managed permissions] The Organizations accounts to which StackSets deploys. StackSets doesn't deploy stack * instances to the organization management account, even if the organization management account is in your organization * or in an OU in your organization. *

*

* For update operations, you can specify either Accounts or OrganizationalUnitIds. For create * and delete operations, specify OrganizationalUnitIds. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DeploymentTargets implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField> ACCOUNTS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Accounts") .getter(getter(DeploymentTargets::accounts)) .setter(setter(Builder::accounts)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Accounts").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 ACCOUNTS_URL_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AccountsUrl").getter(getter(DeploymentTargets::accountsUrl)).setter(setter(Builder::accountsUrl)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccountsUrl").build()).build(); private static final SdkField> ORGANIZATIONAL_UNIT_IDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("OrganizationalUnitIds") .getter(getter(DeploymentTargets::organizationalUnitIds)) .setter(setter(Builder::organizationalUnitIds)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OrganizationalUnitIds").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 ACCOUNT_FILTER_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AccountFilterType").getter(getter(DeploymentTargets::accountFilterTypeAsString)) .setter(setter(Builder::accountFilterType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccountFilterType").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCOUNTS_FIELD, ACCOUNTS_URL_FIELD, ORGANIZATIONAL_UNIT_IDS_FIELD, ACCOUNT_FILTER_TYPE_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final List accounts; private final String accountsUrl; private final List organizationalUnitIds; private final String accountFilterType; private DeploymentTargets(BuilderImpl builder) { this.accounts = builder.accounts; this.accountsUrl = builder.accountsUrl; this.organizationalUnitIds = builder.organizationalUnitIds; this.accountFilterType = builder.accountFilterType; } /** * For responses, this returns true if the service returned a value for the Accounts 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 hasAccounts() { return accounts != null && !(accounts instanceof SdkAutoConstructList); } /** *

* The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates. *

*

* 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 #hasAccounts} method. *

* * @return The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates. */ public final List accounts() { return accounts; } /** *

* Returns the value of the AccountsUrl property. *

* * @return Returns the value of the AccountsUrl property. */ public final String accountsUrl() { return accountsUrl; } /** * For responses, this returns true if the service returned a value for the OrganizationalUnitIds 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 hasOrganizationalUnitIds() { return organizationalUnitIds != null && !(organizationalUnitIds instanceof SdkAutoConstructList); } /** *

* The organization root ID or organizational unit (OU) IDs to which StackSets deploys. *

*

* 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 #hasOrganizationalUnitIds} method. *

* * @return The organization root ID or organizational unit (OU) IDs to which StackSets deploys. */ public final List organizationalUnitIds() { return organizationalUnitIds; } /** *

* Limit deployment targets to individual accounts or include additional accounts with provided OUs. *

*

* The following is a list of possible values for the AccountFilterType operation. *

*
    *
  • *

    * INTERSECTION: StackSets deploys to the accounts specified in Accounts parameter. *

    *
  • *
  • *

    * DIFFERENCE: StackSets excludes the accounts specified in Accounts parameter. This * enables user to avoid certain accounts within an OU such as suspended accounts. *

    *
  • *
  • *

    * UNION: StackSets includes additional accounts deployment targets. *

    *

    * This is the default value if AccountFilterType is not provided. This enables user to update an * entire OU and individual accounts from a different OU in one request, which used to be two separate requests. *

    *
  • *
  • *

    * NONE: Deploys to all the accounts in specified organizational units (OU). *

    *
  • *
*

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

* * @return Limit deployment targets to individual accounts or include additional accounts with provided OUs.

*

* The following is a list of possible values for the AccountFilterType operation. *

*
    *
  • *

    * INTERSECTION: StackSets deploys to the accounts specified in Accounts * parameter. *

    *
  • *
  • *

    * DIFFERENCE: StackSets excludes the accounts specified in Accounts parameter. * This enables user to avoid certain accounts within an OU such as suspended accounts. *

    *
  • *
  • *

    * UNION: StackSets includes additional accounts deployment targets. *

    *

    * This is the default value if AccountFilterType is not provided. This enables user to update * an entire OU and individual accounts from a different OU in one request, which used to be two separate * requests. *

    *
  • *
  • *

    * NONE: Deploys to all the accounts in specified organizational units (OU). *

    *
  • * @see AccountFilterType */ public final AccountFilterType accountFilterType() { return AccountFilterType.fromValue(accountFilterType); } /** *

    * Limit deployment targets to individual accounts or include additional accounts with provided OUs. *

    *

    * The following is a list of possible values for the AccountFilterType operation. *

    *
      *
    • *

      * INTERSECTION: StackSets deploys to the accounts specified in Accounts parameter. *

      *
    • *
    • *

      * DIFFERENCE: StackSets excludes the accounts specified in Accounts parameter. This * enables user to avoid certain accounts within an OU such as suspended accounts. *

      *
    • *
    • *

      * UNION: StackSets includes additional accounts deployment targets. *

      *

      * This is the default value if AccountFilterType is not provided. This enables user to update an * entire OU and individual accounts from a different OU in one request, which used to be two separate requests. *

      *
    • *
    • *

      * NONE: Deploys to all the accounts in specified organizational units (OU). *

      *
    • *
    *

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

    * * @return Limit deployment targets to individual accounts or include additional accounts with provided OUs.

    *

    * The following is a list of possible values for the AccountFilterType operation. *

    *
      *
    • *

      * INTERSECTION: StackSets deploys to the accounts specified in Accounts * parameter. *

      *
    • *
    • *

      * DIFFERENCE: StackSets excludes the accounts specified in Accounts parameter. * This enables user to avoid certain accounts within an OU such as suspended accounts. *

      *
    • *
    • *

      * UNION: StackSets includes additional accounts deployment targets. *

      *

      * This is the default value if AccountFilterType is not provided. This enables user to update * an entire OU and individual accounts from a different OU in one request, which used to be two separate * requests. *

      *
    • *
    • *

      * NONE: Deploys to all the accounts in specified organizational units (OU). *

      *
    • * @see AccountFilterType */ public final String accountFilterTypeAsString() { return accountFilterType; } @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(hasAccounts() ? accounts() : null); hashCode = 31 * hashCode + Objects.hashCode(accountsUrl()); hashCode = 31 * hashCode + Objects.hashCode(hasOrganizationalUnitIds() ? organizationalUnitIds() : null); hashCode = 31 * hashCode + Objects.hashCode(accountFilterTypeAsString()); 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 DeploymentTargets)) { return false; } DeploymentTargets other = (DeploymentTargets) obj; return hasAccounts() == other.hasAccounts() && Objects.equals(accounts(), other.accounts()) && Objects.equals(accountsUrl(), other.accountsUrl()) && hasOrganizationalUnitIds() == other.hasOrganizationalUnitIds() && Objects.equals(organizationalUnitIds(), other.organizationalUnitIds()) && Objects.equals(accountFilterTypeAsString(), other.accountFilterTypeAsString()); } /** * 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("DeploymentTargets").add("Accounts", hasAccounts() ? accounts() : null) .add("AccountsUrl", accountsUrl()) .add("OrganizationalUnitIds", hasOrganizationalUnitIds() ? organizationalUnitIds() : null) .add("AccountFilterType", accountFilterTypeAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Accounts": return Optional.ofNullable(clazz.cast(accounts())); case "AccountsUrl": return Optional.ofNullable(clazz.cast(accountsUrl())); case "OrganizationalUnitIds": return Optional.ofNullable(clazz.cast(organizationalUnitIds())); case "AccountFilterType": return Optional.ofNullable(clazz.cast(accountFilterTypeAsString())); 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("Accounts", ACCOUNTS_FIELD); map.put("AccountsUrl", ACCOUNTS_URL_FIELD); map.put("OrganizationalUnitIds", ORGANIZATIONAL_UNIT_IDS_FIELD); map.put("AccountFilterType", ACCOUNT_FILTER_TYPE_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((DeploymentTargets) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates. *

      * * @param accounts * The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder accounts(Collection accounts); /** *

      * The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates. *

      * * @param accounts * The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates. * @return Returns a reference to this object so that method calls can be chained together. */ Builder accounts(String... accounts); /** *

      * Returns the value of the AccountsUrl property. *

      * * @param accountsUrl * Returns the value of the AccountsUrl property. * @return Returns a reference to this object so that method calls can be chained together. */ Builder accountsUrl(String accountsUrl); /** *

      * The organization root ID or organizational unit (OU) IDs to which StackSets deploys. *

      * * @param organizationalUnitIds * The organization root ID or organizational unit (OU) IDs to which StackSets deploys. * @return Returns a reference to this object so that method calls can be chained together. */ Builder organizationalUnitIds(Collection organizationalUnitIds); /** *

      * The organization root ID or organizational unit (OU) IDs to which StackSets deploys. *

      * * @param organizationalUnitIds * The organization root ID or organizational unit (OU) IDs to which StackSets deploys. * @return Returns a reference to this object so that method calls can be chained together. */ Builder organizationalUnitIds(String... organizationalUnitIds); /** *

      * Limit deployment targets to individual accounts or include additional accounts with provided OUs. *

      *

      * The following is a list of possible values for the AccountFilterType operation. *

      *
        *
      • *

        * INTERSECTION: StackSets deploys to the accounts specified in Accounts parameter. *

        *
      • *
      • *

        * DIFFERENCE: StackSets excludes the accounts specified in Accounts parameter. This * enables user to avoid certain accounts within an OU such as suspended accounts. *

        *
      • *
      • *

        * UNION: StackSets includes additional accounts deployment targets. *

        *

        * This is the default value if AccountFilterType is not provided. This enables user to update an * entire OU and individual accounts from a different OU in one request, which used to be two separate requests. *

        *
      • *
      • *

        * NONE: Deploys to all the accounts in specified organizational units (OU). *

        *
      • *
      * * @param accountFilterType * Limit deployment targets to individual accounts or include additional accounts with provided OUs.

      *

      * The following is a list of possible values for the AccountFilterType operation. *

      *
        *
      • *

        * INTERSECTION: StackSets deploys to the accounts specified in Accounts * parameter. *

        *
      • *
      • *

        * DIFFERENCE: StackSets excludes the accounts specified in Accounts parameter. * This enables user to avoid certain accounts within an OU such as suspended accounts. *

        *
      • *
      • *

        * UNION: StackSets includes additional accounts deployment targets. *

        *

        * This is the default value if AccountFilterType is not provided. This enables user to * update an entire OU and individual accounts from a different OU in one request, which used to be two * separate requests. *

        *
      • *
      • *

        * NONE: Deploys to all the accounts in specified organizational units (OU). *

        *
      • * @see AccountFilterType * @return Returns a reference to this object so that method calls can be chained together. * @see AccountFilterType */ Builder accountFilterType(String accountFilterType); /** *

        * Limit deployment targets to individual accounts or include additional accounts with provided OUs. *

        *

        * The following is a list of possible values for the AccountFilterType operation. *

        *
          *
        • *

          * INTERSECTION: StackSets deploys to the accounts specified in Accounts parameter. *

          *
        • *
        • *

          * DIFFERENCE: StackSets excludes the accounts specified in Accounts parameter. This * enables user to avoid certain accounts within an OU such as suspended accounts. *

          *
        • *
        • *

          * UNION: StackSets includes additional accounts deployment targets. *

          *

          * This is the default value if AccountFilterType is not provided. This enables user to update an * entire OU and individual accounts from a different OU in one request, which used to be two separate requests. *

          *
        • *
        • *

          * NONE: Deploys to all the accounts in specified organizational units (OU). *

          *
        • *
        * * @param accountFilterType * Limit deployment targets to individual accounts or include additional accounts with provided OUs.

        *

        * The following is a list of possible values for the AccountFilterType operation. *

        *
          *
        • *

          * INTERSECTION: StackSets deploys to the accounts specified in Accounts * parameter. *

          *
        • *
        • *

          * DIFFERENCE: StackSets excludes the accounts specified in Accounts parameter. * This enables user to avoid certain accounts within an OU such as suspended accounts. *

          *
        • *
        • *

          * UNION: StackSets includes additional accounts deployment targets. *

          *

          * This is the default value if AccountFilterType is not provided. This enables user to * update an entire OU and individual accounts from a different OU in one request, which used to be two * separate requests. *

          *
        • *
        • *

          * NONE: Deploys to all the accounts in specified organizational units (OU). *

          *
        • * @see AccountFilterType * @return Returns a reference to this object so that method calls can be chained together. * @see AccountFilterType */ Builder accountFilterType(AccountFilterType accountFilterType); } static final class BuilderImpl implements Builder { private List accounts = DefaultSdkAutoConstructList.getInstance(); private String accountsUrl; private List organizationalUnitIds = DefaultSdkAutoConstructList.getInstance(); private String accountFilterType; private BuilderImpl() { } private BuilderImpl(DeploymentTargets model) { accounts(model.accounts); accountsUrl(model.accountsUrl); organizationalUnitIds(model.organizationalUnitIds); accountFilterType(model.accountFilterType); } public final Collection getAccounts() { if (accounts instanceof SdkAutoConstructList) { return null; } return accounts; } public final void setAccounts(Collection accounts) { this.accounts = AccountListCopier.copy(accounts); } @Override public final Builder accounts(Collection accounts) { this.accounts = AccountListCopier.copy(accounts); return this; } @Override @SafeVarargs public final Builder accounts(String... accounts) { accounts(Arrays.asList(accounts)); return this; } public final String getAccountsUrl() { return accountsUrl; } public final void setAccountsUrl(String accountsUrl) { this.accountsUrl = accountsUrl; } @Override public final Builder accountsUrl(String accountsUrl) { this.accountsUrl = accountsUrl; return this; } public final Collection getOrganizationalUnitIds() { if (organizationalUnitIds instanceof SdkAutoConstructList) { return null; } return organizationalUnitIds; } public final void setOrganizationalUnitIds(Collection organizationalUnitIds) { this.organizationalUnitIds = OrganizationalUnitIdListCopier.copy(organizationalUnitIds); } @Override public final Builder organizationalUnitIds(Collection organizationalUnitIds) { this.organizationalUnitIds = OrganizationalUnitIdListCopier.copy(organizationalUnitIds); return this; } @Override @SafeVarargs public final Builder organizationalUnitIds(String... organizationalUnitIds) { organizationalUnitIds(Arrays.asList(organizationalUnitIds)); return this; } public final String getAccountFilterType() { return accountFilterType; } public final void setAccountFilterType(String accountFilterType) { this.accountFilterType = accountFilterType; } @Override public final Builder accountFilterType(String accountFilterType) { this.accountFilterType = accountFilterType; return this; } @Override public final Builder accountFilterType(AccountFilterType accountFilterType) { this.accountFilterType(accountFilterType == null ? null : accountFilterType.toString()); return this; } @Override public DeploymentTargets build() { return new DeploymentTargets(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy