Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.fms.model.Policy Maven / Gradle / Ivy
Go to download
The AWS Java SDK for FMS module holds the client classes that are used for
communicating with FMS.
/*
* 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.fms.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* An AWS Firewall Manager policy.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Policy implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField POLICY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Policy::policyId)).setter(setter(Builder::policyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolicyId").build()).build();
private static final SdkField POLICY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Policy::policyName)).setter(setter(Builder::policyName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolicyName").build()).build();
private static final SdkField POLICY_UPDATE_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Policy::policyUpdateToken)).setter(setter(Builder::policyUpdateToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolicyUpdateToken").build()).build();
private static final SdkField SECURITY_SERVICE_POLICY_DATA_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(Policy::securityServicePolicyData))
.setter(setter(Builder::securityServicePolicyData)).constructor(SecurityServicePolicyData::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecurityServicePolicyData").build())
.build();
private static final SdkField RESOURCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Policy::resourceType)).setter(setter(Builder::resourceType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceType").build()).build();
private static final SdkField> RESOURCE_TYPE_LIST_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(Policy::resourceTypeList))
.setter(setter(Builder::resourceTypeList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceTypeList").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> RESOURCE_TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(Policy::resourceTags))
.setter(setter(Builder::resourceTags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceTags").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(ResourceTag::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField EXCLUDE_RESOURCE_TAGS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(Policy::excludeResourceTags)).setter(setter(Builder::excludeResourceTags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExcludeResourceTags").build())
.build();
private static final SdkField REMEDIATION_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(Policy::remediationEnabled)).setter(setter(Builder::remediationEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RemediationEnabled").build())
.build();
private static final SdkField>> INCLUDE_MAP_FIELD = SdkField
.>> builder(MarshallingType.MAP)
.getter(getter(Policy::includeMapAsStrings))
.setter(setter(Builder::includeMapWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IncludeMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField>> EXCLUDE_MAP_FIELD = SdkField
.>> builder(MarshallingType.MAP)
.getter(getter(Policy::excludeMapAsStrings))
.setter(setter(Builder::excludeMapWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExcludeMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(POLICY_ID_FIELD,
POLICY_NAME_FIELD, POLICY_UPDATE_TOKEN_FIELD, SECURITY_SERVICE_POLICY_DATA_FIELD, RESOURCE_TYPE_FIELD,
RESOURCE_TYPE_LIST_FIELD, RESOURCE_TAGS_FIELD, EXCLUDE_RESOURCE_TAGS_FIELD, REMEDIATION_ENABLED_FIELD,
INCLUDE_MAP_FIELD, EXCLUDE_MAP_FIELD));
private static final long serialVersionUID = 1L;
private final String policyId;
private final String policyName;
private final String policyUpdateToken;
private final SecurityServicePolicyData securityServicePolicyData;
private final String resourceType;
private final List resourceTypeList;
private final List resourceTags;
private final Boolean excludeResourceTags;
private final Boolean remediationEnabled;
private final Map> includeMap;
private final Map> excludeMap;
private Policy(BuilderImpl builder) {
this.policyId = builder.policyId;
this.policyName = builder.policyName;
this.policyUpdateToken = builder.policyUpdateToken;
this.securityServicePolicyData = builder.securityServicePolicyData;
this.resourceType = builder.resourceType;
this.resourceTypeList = builder.resourceTypeList;
this.resourceTags = builder.resourceTags;
this.excludeResourceTags = builder.excludeResourceTags;
this.remediationEnabled = builder.remediationEnabled;
this.includeMap = builder.includeMap;
this.excludeMap = builder.excludeMap;
}
/**
*
* The ID of the AWS Firewall Manager policy.
*
*
* @return The ID of the AWS Firewall Manager policy.
*/
public String policyId() {
return policyId;
}
/**
*
* The friendly name of the AWS Firewall Manager policy.
*
*
* @return The friendly name of the AWS Firewall Manager policy.
*/
public String policyName() {
return policyName;
}
/**
*
* A unique identifier for each update to the policy. When issuing a PutPolicy
request, the
* PolicyUpdateToken
in the request must match the PolicyUpdateToken
of the current policy
* version. To get the PolicyUpdateToken
of the current policy version, use a GetPolicy
* request.
*
*
* @return A unique identifier for each update to the policy. When issuing a PutPolicy
request, the
* PolicyUpdateToken
in the request must match the PolicyUpdateToken
of the
* current policy version. To get the PolicyUpdateToken
of the current policy version, use a
* GetPolicy
request.
*/
public String policyUpdateToken() {
return policyUpdateToken;
}
/**
*
* Details about the security service that is being used to protect the resources.
*
*
* @return Details about the security service that is being used to protect the resources.
*/
public SecurityServicePolicyData securityServicePolicyData() {
return securityServicePolicyData;
}
/**
*
* The type of resource protected by or in scope of the policy. This is in the format shown in the AWS
* Resource Types Reference . For AWS WAF and Shield Advanced, examples include
* AWS::ElasticLoadBalancingV2::LoadBalancer
and AWS::CloudFront::Distribution
. For a
* security group common policy, valid values are AWS::EC2::NetworkInterface
and
* AWS::EC2::Instance
. For a security group content audit policy, valid values are
* AWS::EC2::SecurityGroup
, AWS::EC2::NetworkInterface
, and
* AWS::EC2::Instance
. For a security group usage audit policy, the value is
* AWS::EC2::SecurityGroup
.
*
*
* @return The type of resource protected by or in scope of the policy. This is in the format shown in the AWS Resource Types Reference . For AWS WAF and Shield Advanced, examples include
* AWS::ElasticLoadBalancingV2::LoadBalancer
and AWS::CloudFront::Distribution
.
* For a security group common policy, valid values are AWS::EC2::NetworkInterface
and
* AWS::EC2::Instance
. For a security group content audit policy, valid values are
* AWS::EC2::SecurityGroup
, AWS::EC2::NetworkInterface
, and
* AWS::EC2::Instance
. For a security group usage audit policy, the value is
* AWS::EC2::SecurityGroup
.
*/
public String resourceType() {
return resourceType;
}
/**
* Returns true if the ResourceTypeList property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public boolean hasResourceTypeList() {
return resourceTypeList != null && !(resourceTypeList instanceof SdkAutoConstructList);
}
/**
*
* An array of ResourceType
.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasResourceTypeList()} to see if a value was sent in this field.
*
*
* @return An array of ResourceType
.
*/
public List resourceTypeList() {
return resourceTypeList;
}
/**
* Returns true if the ResourceTags property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasResourceTags() {
return resourceTags != null && !(resourceTags instanceof SdkAutoConstructList);
}
/**
*
* An array of ResourceTag
objects.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasResourceTags()} to see if a value was sent in this field.
*
*
* @return An array of ResourceTag
objects.
*/
public List resourceTags() {
return resourceTags;
}
/**
*
* If set to True
, resources with the tags that are specified in the ResourceTag
array are
* not in scope of the policy. If set to False
, and the ResourceTag
array is not null,
* only resources with the specified tags are in scope of the policy.
*
*
* @return If set to True
, resources with the tags that are specified in the ResourceTag
* array are not in scope of the policy. If set to False
, and the ResourceTag
* array is not null, only resources with the specified tags are in scope of the policy.
*/
public Boolean excludeResourceTags() {
return excludeResourceTags;
}
/**
*
* Indicates if the policy should be automatically applied to new resources.
*
*
* @return Indicates if the policy should be automatically applied to new resources.
*/
public Boolean remediationEnabled() {
return remediationEnabled;
}
/**
*
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy.
* Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including
* any child OUs and accounts that are added at a later time.
*
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS Firewall
* Manager applies the policy to all accounts specified by the IncludeMap
, and does not evaluate any
* ExcludeMap
specifications. If you do not specify an IncludeMap
, then Firewall Manager
* applies the policy to all accounts except for those specified by the ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasIncludeMap()} to see if a value was sent in this field.
*
*
* @return Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy.
* Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs,
* including any child OUs and accounts that are added at a later time.
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does
* not evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
* , then Firewall Manager applies the policy to all accounts except for those specified by the
* ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is
* a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
* .
*
*
*/
public Map> includeMap() {
return CustomerPolicyScopeMapCopier.copyStringToEnum(includeMap);
}
/**
* Returns true if the IncludeMap property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasIncludeMap() {
return includeMap != null && !(includeMap instanceof SdkAutoConstructMap);
}
/**
*
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy.
* Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including
* any child OUs and accounts that are added at a later time.
*
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS Firewall
* Manager applies the policy to all accounts specified by the IncludeMap
, and does not evaluate any
* ExcludeMap
specifications. If you do not specify an IncludeMap
, then Firewall Manager
* applies the policy to all accounts except for those specified by the ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasIncludeMap()} to see if a value was sent in this field.
*
*
* @return Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy.
* Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs,
* including any child OUs and accounts that are added at a later time.
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does
* not evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
* , then Firewall Manager applies the policy to all accounts except for those specified by the
* ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is
* a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
* .
*
*
*/
public Map> includeMapAsStrings() {
return includeMap;
}
/**
*
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the policy.
* Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including
* any child OUs and accounts that are added at a later time.
*
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS Firewall
* Manager applies the policy to all accounts specified by the IncludeMap
, and does not evaluate any
* ExcludeMap
specifications. If you do not specify an IncludeMap
, then Firewall Manager
* applies the policy to all accounts except for those specified by the ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasExcludeMap()} to see if a value was sent in this field.
*
*
* @return Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the
* policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child
* OUs, including any child OUs and accounts that are added at a later time.
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does
* not evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
* , then Firewall Manager applies the policy to all accounts except for those specified by the
* ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is
* a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
* .
*
*
*/
public Map> excludeMap() {
return CustomerPolicyScopeMapCopier.copyStringToEnum(excludeMap);
}
/**
* Returns true if the ExcludeMap property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasExcludeMap() {
return excludeMap != null && !(excludeMap instanceof SdkAutoConstructMap);
}
/**
*
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the policy.
* Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including
* any child OUs and accounts that are added at a later time.
*
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS Firewall
* Manager applies the policy to all accounts specified by the IncludeMap
, and does not evaluate any
* ExcludeMap
specifications. If you do not specify an IncludeMap
, then Firewall Manager
* applies the policy to all accounts except for those specified by the ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasExcludeMap()} to see if a value was sent in this field.
*
*
* @return Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the
* policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child
* OUs, including any child OUs and accounts that are added at a later time.
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does
* not evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
* , then Firewall Manager applies the policy to all accounts except for those specified by the
* ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is
* a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
* .
*
*
*/
public Map> excludeMapAsStrings() {
return excludeMap;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(policyId());
hashCode = 31 * hashCode + Objects.hashCode(policyName());
hashCode = 31 * hashCode + Objects.hashCode(policyUpdateToken());
hashCode = 31 * hashCode + Objects.hashCode(securityServicePolicyData());
hashCode = 31 * hashCode + Objects.hashCode(resourceType());
hashCode = 31 * hashCode + Objects.hashCode(resourceTypeList());
hashCode = 31 * hashCode + Objects.hashCode(resourceTags());
hashCode = 31 * hashCode + Objects.hashCode(excludeResourceTags());
hashCode = 31 * hashCode + Objects.hashCode(remediationEnabled());
hashCode = 31 * hashCode + Objects.hashCode(includeMapAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(excludeMapAsStrings());
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 Policy)) {
return false;
}
Policy other = (Policy) obj;
return Objects.equals(policyId(), other.policyId()) && Objects.equals(policyName(), other.policyName())
&& Objects.equals(policyUpdateToken(), other.policyUpdateToken())
&& Objects.equals(securityServicePolicyData(), other.securityServicePolicyData())
&& Objects.equals(resourceType(), other.resourceType())
&& Objects.equals(resourceTypeList(), other.resourceTypeList())
&& Objects.equals(resourceTags(), other.resourceTags())
&& Objects.equals(excludeResourceTags(), other.excludeResourceTags())
&& Objects.equals(remediationEnabled(), other.remediationEnabled())
&& Objects.equals(includeMapAsStrings(), other.includeMapAsStrings())
&& Objects.equals(excludeMapAsStrings(), other.excludeMapAsStrings());
}
/**
* 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("Policy").add("PolicyId", policyId()).add("PolicyName", policyName())
.add("PolicyUpdateToken", policyUpdateToken()).add("SecurityServicePolicyData", securityServicePolicyData())
.add("ResourceType", resourceType()).add("ResourceTypeList", resourceTypeList())
.add("ResourceTags", resourceTags()).add("ExcludeResourceTags", excludeResourceTags())
.add("RemediationEnabled", remediationEnabled()).add("IncludeMap", includeMapAsStrings())
.add("ExcludeMap", excludeMapAsStrings()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "PolicyId":
return Optional.ofNullable(clazz.cast(policyId()));
case "PolicyName":
return Optional.ofNullable(clazz.cast(policyName()));
case "PolicyUpdateToken":
return Optional.ofNullable(clazz.cast(policyUpdateToken()));
case "SecurityServicePolicyData":
return Optional.ofNullable(clazz.cast(securityServicePolicyData()));
case "ResourceType":
return Optional.ofNullable(clazz.cast(resourceType()));
case "ResourceTypeList":
return Optional.ofNullable(clazz.cast(resourceTypeList()));
case "ResourceTags":
return Optional.ofNullable(clazz.cast(resourceTags()));
case "ExcludeResourceTags":
return Optional.ofNullable(clazz.cast(excludeResourceTags()));
case "RemediationEnabled":
return Optional.ofNullable(clazz.cast(remediationEnabled()));
case "IncludeMap":
return Optional.ofNullable(clazz.cast(includeMapAsStrings()));
case "ExcludeMap":
return Optional.ofNullable(clazz.cast(excludeMapAsStrings()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((Policy) 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 AWS Firewall Manager policy.
*
*
* @param policyId
* The ID of the AWS Firewall Manager policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder policyId(String policyId);
/**
*
* The friendly name of the AWS Firewall Manager policy.
*
*
* @param policyName
* The friendly name of the AWS Firewall Manager policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder policyName(String policyName);
/**
*
* A unique identifier for each update to the policy. When issuing a PutPolicy
request, the
* PolicyUpdateToken
in the request must match the PolicyUpdateToken
of the current
* policy version. To get the PolicyUpdateToken
of the current policy version, use a
* GetPolicy
request.
*
*
* @param policyUpdateToken
* A unique identifier for each update to the policy. When issuing a PutPolicy
request, the
* PolicyUpdateToken
in the request must match the PolicyUpdateToken
of the
* current policy version. To get the PolicyUpdateToken
of the current policy version, use a
* GetPolicy
request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder policyUpdateToken(String policyUpdateToken);
/**
*
* Details about the security service that is being used to protect the resources.
*
*
* @param securityServicePolicyData
* Details about the security service that is being used to protect the resources.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder securityServicePolicyData(SecurityServicePolicyData securityServicePolicyData);
/**
*
* Details about the security service that is being used to protect the resources.
*
* This is a convenience that creates an instance of the {@link SecurityServicePolicyData.Builder} avoiding the
* need to create one manually via {@link SecurityServicePolicyData#builder()}.
*
* When the {@link Consumer} completes, {@link SecurityServicePolicyData.Builder#build()} is called immediately
* and its result is passed to {@link #securityServicePolicyData(SecurityServicePolicyData)}.
*
* @param securityServicePolicyData
* a consumer that will call methods on {@link SecurityServicePolicyData.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #securityServicePolicyData(SecurityServicePolicyData)
*/
default Builder securityServicePolicyData(Consumer securityServicePolicyData) {
return securityServicePolicyData(SecurityServicePolicyData.builder().applyMutation(securityServicePolicyData).build());
}
/**
*
* The type of resource protected by or in scope of the policy. This is in the format shown in the AWS
* Resource Types Reference . For AWS WAF and Shield Advanced, examples include
* AWS::ElasticLoadBalancingV2::LoadBalancer
and AWS::CloudFront::Distribution
. For a
* security group common policy, valid values are AWS::EC2::NetworkInterface
and
* AWS::EC2::Instance
. For a security group content audit policy, valid values are
* AWS::EC2::SecurityGroup
, AWS::EC2::NetworkInterface
, and
* AWS::EC2::Instance
. For a security group usage audit policy, the value is
* AWS::EC2::SecurityGroup
.
*
*
* @param resourceType
* The type of resource protected by or in scope of the policy. This is in the format shown in the AWS Resource Types Reference . For AWS WAF and Shield Advanced, examples include
* AWS::ElasticLoadBalancingV2::LoadBalancer
and AWS::CloudFront::Distribution
.
* For a security group common policy, valid values are AWS::EC2::NetworkInterface
and
* AWS::EC2::Instance
. For a security group content audit policy, valid values are
* AWS::EC2::SecurityGroup
, AWS::EC2::NetworkInterface
, and
* AWS::EC2::Instance
. For a security group usage audit policy, the value is
* AWS::EC2::SecurityGroup
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceType(String resourceType);
/**
*
* An array of ResourceType
.
*
*
* @param resourceTypeList
* An array of ResourceType
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceTypeList(Collection resourceTypeList);
/**
*
* An array of ResourceType
.
*
*
* @param resourceTypeList
* An array of ResourceType
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceTypeList(String... resourceTypeList);
/**
*
* An array of ResourceTag
objects.
*
*
* @param resourceTags
* An array of ResourceTag
objects.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceTags(Collection resourceTags);
/**
*
* An array of ResourceTag
objects.
*
*
* @param resourceTags
* An array of ResourceTag
objects.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceTags(ResourceTag... resourceTags);
/**
*
* An array of ResourceTag
objects.
*
* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to
* create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its
* result is passed to {@link #resourceTags(List)}.
*
* @param resourceTags
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #resourceTags(List)
*/
Builder resourceTags(Consumer... resourceTags);
/**
*
* If set to True
, resources with the tags that are specified in the ResourceTag
array
* are not in scope of the policy. If set to False
, and the ResourceTag
array is not
* null, only resources with the specified tags are in scope of the policy.
*
*
* @param excludeResourceTags
* If set to True
, resources with the tags that are specified in the
* ResourceTag
array are not in scope of the policy. If set to False
, and the
* ResourceTag
array is not null, only resources with the specified tags are in scope of the
* policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder excludeResourceTags(Boolean excludeResourceTags);
/**
*
* Indicates if the policy should be automatically applied to new resources.
*
*
* @param remediationEnabled
* Indicates if the policy should be automatically applied to new resources.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder remediationEnabled(Boolean remediationEnabled);
/**
*
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy.
* Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs,
* including any child OUs and accounts that are added at a later time.
*
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does not
* evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
, then
* Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap
* .
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a
* valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* @param includeMap
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the
* policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its
* child OUs, including any child OUs and accounts that are added at a later time.
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does
* not evaluate any ExcludeMap
specifications. If you do not specify an
* IncludeMap
, then Firewall Manager applies the policy to all accounts except for those
* specified by the ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following
* is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder includeMapWithStrings(Map> includeMap);
/**
*
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy.
* Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs,
* including any child OUs and accounts that are added at a later time.
*
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does not
* evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
, then
* Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap
* .
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a
* valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* @param includeMap
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the
* policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its
* child OUs, including any child OUs and accounts that are added at a later time.
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does
* not evaluate any ExcludeMap
specifications. If you do not specify an
* IncludeMap
, then Firewall Manager applies the policy to all accounts except for those
* specified by the ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following
* is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder includeMap(Map> includeMap);
/**
*
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the policy.
* Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs,
* including any child OUs and accounts that are added at a later time.
*
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does not
* evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
, then
* Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap
* .
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a
* valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* @param excludeMap
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the
* policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its
* child OUs, including any child OUs and accounts that are added at a later time.
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does
* not evaluate any ExcludeMap
specifications. If you do not specify an
* IncludeMap
, then Firewall Manager applies the policy to all accounts except for those
* specified by the ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following
* is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder excludeMapWithStrings(Map> excludeMap);
/**
*
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the policy.
* Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs,
* including any child OUs and accounts that are added at a later time.
*
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does not
* evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
, then
* Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap
* .
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a
* valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* @param excludeMap
* Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the
* policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its
* child OUs, including any child OUs and accounts that are added at a later time.
*
* You can specify inclusions or exclusions, but not both. If you specify an IncludeMap
, AWS
* Firewall Manager applies the policy to all accounts specified by the IncludeMap
, and does
* not evaluate any ExcludeMap
specifications. If you do not specify an
* IncludeMap
, then Firewall Manager applies the policy to all accounts except for those
* specified by the ExcludeMap
.
*
*
* You can specify account IDs, OUs, or a combination:
*
*
*
*
* Specify account IDs by setting the key to ACCOUNT
. For example, the following is a valid
* map: {“ACCOUNT” : [“accountID1”, “accountID2”]}
.
*
*
*
*
* Specify OUs by setting the key to ORG_UNIT
. For example, the following is a valid map:
* {“ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
*
*
* Specify accounts and OUs together in a single map, separated with a comma. For example, the following
* is a valid map:
* {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder excludeMap(Map> excludeMap);
}
static final class BuilderImpl implements Builder {
private String policyId;
private String policyName;
private String policyUpdateToken;
private SecurityServicePolicyData securityServicePolicyData;
private String resourceType;
private List resourceTypeList = DefaultSdkAutoConstructList.getInstance();
private List resourceTags = DefaultSdkAutoConstructList.getInstance();
private Boolean excludeResourceTags;
private Boolean remediationEnabled;
private Map> includeMap = DefaultSdkAutoConstructMap.getInstance();
private Map> excludeMap = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(Policy model) {
policyId(model.policyId);
policyName(model.policyName);
policyUpdateToken(model.policyUpdateToken);
securityServicePolicyData(model.securityServicePolicyData);
resourceType(model.resourceType);
resourceTypeList(model.resourceTypeList);
resourceTags(model.resourceTags);
excludeResourceTags(model.excludeResourceTags);
remediationEnabled(model.remediationEnabled);
includeMapWithStrings(model.includeMap);
excludeMapWithStrings(model.excludeMap);
}
public final String getPolicyId() {
return policyId;
}
@Override
public final Builder policyId(String policyId) {
this.policyId = policyId;
return this;
}
public final void setPolicyId(String policyId) {
this.policyId = policyId;
}
public final String getPolicyName() {
return policyName;
}
@Override
public final Builder policyName(String policyName) {
this.policyName = policyName;
return this;
}
public final void setPolicyName(String policyName) {
this.policyName = policyName;
}
public final String getPolicyUpdateToken() {
return policyUpdateToken;
}
@Override
public final Builder policyUpdateToken(String policyUpdateToken) {
this.policyUpdateToken = policyUpdateToken;
return this;
}
public final void setPolicyUpdateToken(String policyUpdateToken) {
this.policyUpdateToken = policyUpdateToken;
}
public final SecurityServicePolicyData.Builder getSecurityServicePolicyData() {
return securityServicePolicyData != null ? securityServicePolicyData.toBuilder() : null;
}
@Override
public final Builder securityServicePolicyData(SecurityServicePolicyData securityServicePolicyData) {
this.securityServicePolicyData = securityServicePolicyData;
return this;
}
public final void setSecurityServicePolicyData(SecurityServicePolicyData.BuilderImpl securityServicePolicyData) {
this.securityServicePolicyData = securityServicePolicyData != null ? securityServicePolicyData.build() : null;
}
public final String getResourceType() {
return resourceType;
}
@Override
public final Builder resourceType(String resourceType) {
this.resourceType = resourceType;
return this;
}
public final void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
public final Collection getResourceTypeList() {
return resourceTypeList;
}
@Override
public final Builder resourceTypeList(Collection resourceTypeList) {
this.resourceTypeList = ResourceTypeListCopier.copy(resourceTypeList);
return this;
}
@Override
@SafeVarargs
public final Builder resourceTypeList(String... resourceTypeList) {
resourceTypeList(Arrays.asList(resourceTypeList));
return this;
}
public final void setResourceTypeList(Collection resourceTypeList) {
this.resourceTypeList = ResourceTypeListCopier.copy(resourceTypeList);
}
public final Collection getResourceTags() {
return resourceTags != null ? resourceTags.stream().map(ResourceTag::toBuilder).collect(Collectors.toList()) : null;
}
@Override
public final Builder resourceTags(Collection resourceTags) {
this.resourceTags = ResourceTagsCopier.copy(resourceTags);
return this;
}
@Override
@SafeVarargs
public final Builder resourceTags(ResourceTag... resourceTags) {
resourceTags(Arrays.asList(resourceTags));
return this;
}
@Override
@SafeVarargs
public final Builder resourceTags(Consumer... resourceTags) {
resourceTags(Stream.of(resourceTags).map(c -> ResourceTag.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final void setResourceTags(Collection resourceTags) {
this.resourceTags = ResourceTagsCopier.copyFromBuilder(resourceTags);
}
public final Boolean getExcludeResourceTags() {
return excludeResourceTags;
}
@Override
public final Builder excludeResourceTags(Boolean excludeResourceTags) {
this.excludeResourceTags = excludeResourceTags;
return this;
}
public final void setExcludeResourceTags(Boolean excludeResourceTags) {
this.excludeResourceTags = excludeResourceTags;
}
public final Boolean getRemediationEnabled() {
return remediationEnabled;
}
@Override
public final Builder remediationEnabled(Boolean remediationEnabled) {
this.remediationEnabled = remediationEnabled;
return this;
}
public final void setRemediationEnabled(Boolean remediationEnabled) {
this.remediationEnabled = remediationEnabled;
}
public final Map> getIncludeMap() {
return includeMap;
}
@Override
public final Builder includeMapWithStrings(Map> includeMap) {
this.includeMap = CustomerPolicyScopeMapCopier.copy(includeMap);
return this;
}
@Override
public final Builder includeMap(Map> includeMap) {
this.includeMap = CustomerPolicyScopeMapCopier.copyEnumToString(includeMap);
return this;
}
public final void setIncludeMap(Map> includeMap) {
this.includeMap = CustomerPolicyScopeMapCopier.copy(includeMap);
}
public final Map> getExcludeMap() {
return excludeMap;
}
@Override
public final Builder excludeMapWithStrings(Map> excludeMap) {
this.excludeMap = CustomerPolicyScopeMapCopier.copy(excludeMap);
return this;
}
@Override
public final Builder excludeMap(Map> excludeMap) {
this.excludeMap = CustomerPolicyScopeMapCopier.copyEnumToString(excludeMap);
return this;
}
public final void setExcludeMap(Map> excludeMap) {
this.excludeMap = CustomerPolicyScopeMapCopier.copy(excludeMap);
}
@Override
public Policy build() {
return new Policy(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}