
com.amazonaws.services.config.model.RecordingGroup Maven / Gradle / Ivy
Show all versions of aws-java-sdk-config Show documentation
/*
* Copyright 2010-2016 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 com.amazonaws.services.config.model;
import java.io.Serializable;
/**
*
* Specifies the types of AWS resource for which AWS Config records
* configuration changes.
*
*
* In the recording group, you specify whether all supported types or specific
* types of resources are recorded.
*
*
* By default, AWS Config records configuration changes for all supported types
* of regional resources that AWS Config discovers in the region in which it is
* running. Regional resources are tied to a region and can be used only in that
* region. Examples of regional resources are EC2 instances and EBS volumes.
*
*
* You can also have AWS Config record configuration changes for supported types
* of global resources (for example, IAM resources). Global resources are not
* tied to an individual region and can be used in all regions.
*
* The configuration details for any global resource are the same in
* all regions. If you customize AWS Config in multiple regions to record global
* resources, it will create multiple configuration items each time a global
* resource changes: one configuration item for each region. These configuration
* items will contain identical data. To prevent duplicate configuration items,
* you should consider customizing AWS Config in only one region to record
* global resources, unless you want the configuration items to be available in
* multiple regions.
*
* If you don't want AWS Config to record all resources, you can specify which
* types of resources it will record with the resourceTypes
* parameter.
*
*
* For a list of supported resource types, see Supported resource types.
*
*
* For more information, see Selecting Which Resources AWS Config Records.
*
*/
public class RecordingGroup implements Serializable, Cloneable {
/**
*
* Specifies whether AWS Config records configuration changes for every
* supported type of regional resource.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of regional resource, it automatically starts recording
* resources of that type.
*
*
* If you set this option to true
, you cannot enumerate a list
* of resourceTypes
.
*
*/
private Boolean allSupported;
/**
*
* Specifies whether AWS Config includes all supported types of global
* resources (for example, IAM resources) with the resources that it
* records.
*
*
* Before you can set this option to true
, you must set the
* allSupported
option to true
.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of global resource, it automatically starts recording
* resources of that type.
*
*
* The configuration details for any global resource are the same in all
* regions. To prevent duplicate configuration items, you should consider
* customizing AWS Config in only one region to record global resources.
*
*/
private Boolean includeGlobalResourceTypes;
/**
*
* A comma-separated list that specifies the types of AWS resources for
* which AWS Config records configuration changes (for example,
* AWS::EC2::Instance
or AWS::CloudTrail::Trail
).
*
*
* Before you can set this option to true
, you must set the
* allSupported
option to false
.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of resource, it will not record resources of that type
* unless you manually add that type to your recording group.
*
*
* For a list of valid resourceTypes
values, see the
* resourceType Value column in Supported AWS Resource Types.
*
*/
private com.amazonaws.internal.SdkInternalList resourceTypes;
/**
*
* Specifies whether AWS Config records configuration changes for every
* supported type of regional resource.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of regional resource, it automatically starts recording
* resources of that type.
*
*
* If you set this option to true
, you cannot enumerate a list
* of resourceTypes
.
*
*
* @param allSupported
* Specifies whether AWS Config records configuration changes for
* every supported type of regional resource.
*
* If you set this option to true
, when AWS Config adds
* support for a new type of regional resource, it automatically
* starts recording resources of that type.
*
*
* If you set this option to true
, you cannot enumerate
* a list of resourceTypes
.
*/
public void setAllSupported(Boolean allSupported) {
this.allSupported = allSupported;
}
/**
*
* Specifies whether AWS Config records configuration changes for every
* supported type of regional resource.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of regional resource, it automatically starts recording
* resources of that type.
*
*
* If you set this option to true
, you cannot enumerate a list
* of resourceTypes
.
*
*
* @return Specifies whether AWS Config records configuration changes for
* every supported type of regional resource.
*
* If you set this option to true
, when AWS Config adds
* support for a new type of regional resource, it automatically
* starts recording resources of that type.
*
*
* If you set this option to true
, you cannot enumerate
* a list of resourceTypes
.
*/
public Boolean getAllSupported() {
return this.allSupported;
}
/**
*
* Specifies whether AWS Config records configuration changes for every
* supported type of regional resource.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of regional resource, it automatically starts recording
* resources of that type.
*
*
* If you set this option to true
, you cannot enumerate a list
* of resourceTypes
.
*
*
* @param allSupported
* Specifies whether AWS Config records configuration changes for
* every supported type of regional resource.
*
* If you set this option to true
, when AWS Config adds
* support for a new type of regional resource, it automatically
* starts recording resources of that type.
*
*
* If you set this option to true
, you cannot enumerate
* a list of resourceTypes
.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RecordingGroup withAllSupported(Boolean allSupported) {
setAllSupported(allSupported);
return this;
}
/**
*
* Specifies whether AWS Config records configuration changes for every
* supported type of regional resource.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of regional resource, it automatically starts recording
* resources of that type.
*
*
* If you set this option to true
, you cannot enumerate a list
* of resourceTypes
.
*
*
* @return Specifies whether AWS Config records configuration changes for
* every supported type of regional resource.
*
* If you set this option to true
, when AWS Config adds
* support for a new type of regional resource, it automatically
* starts recording resources of that type.
*
*
* If you set this option to true
, you cannot enumerate
* a list of resourceTypes
.
*/
public Boolean isAllSupported() {
return this.allSupported;
}
/**
*
* Specifies whether AWS Config includes all supported types of global
* resources (for example, IAM resources) with the resources that it
* records.
*
*
* Before you can set this option to true
, you must set the
* allSupported
option to true
.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of global resource, it automatically starts recording
* resources of that type.
*
*
* The configuration details for any global resource are the same in all
* regions. To prevent duplicate configuration items, you should consider
* customizing AWS Config in only one region to record global resources.
*
*
* @param includeGlobalResourceTypes
* Specifies whether AWS Config includes all supported types of
* global resources (for example, IAM resources) with the resources
* that it records.
*
* Before you can set this option to true
, you must set
* the allSupported
option to true
.
*
*
* If you set this option to true
, when AWS Config adds
* support for a new type of global resource, it automatically starts
* recording resources of that type.
*
*
* The configuration details for any global resource are the same in
* all regions. To prevent duplicate configuration items, you should
* consider customizing AWS Config in only one region to record
* global resources.
*/
public void setIncludeGlobalResourceTypes(Boolean includeGlobalResourceTypes) {
this.includeGlobalResourceTypes = includeGlobalResourceTypes;
}
/**
*
* Specifies whether AWS Config includes all supported types of global
* resources (for example, IAM resources) with the resources that it
* records.
*
*
* Before you can set this option to true
, you must set the
* allSupported
option to true
.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of global resource, it automatically starts recording
* resources of that type.
*
*
* The configuration details for any global resource are the same in all
* regions. To prevent duplicate configuration items, you should consider
* customizing AWS Config in only one region to record global resources.
*
*
* @return Specifies whether AWS Config includes all supported types of
* global resources (for example, IAM resources) with the resources
* that it records.
*
* Before you can set this option to true
, you must set
* the allSupported
option to true
.
*
*
* If you set this option to true
, when AWS Config adds
* support for a new type of global resource, it automatically
* starts recording resources of that type.
*
*
* The configuration details for any global resource are the same in
* all regions. To prevent duplicate configuration items, you should
* consider customizing AWS Config in only one region to record
* global resources.
*/
public Boolean getIncludeGlobalResourceTypes() {
return this.includeGlobalResourceTypes;
}
/**
*
* Specifies whether AWS Config includes all supported types of global
* resources (for example, IAM resources) with the resources that it
* records.
*
*
* Before you can set this option to true
, you must set the
* allSupported
option to true
.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of global resource, it automatically starts recording
* resources of that type.
*
*
* The configuration details for any global resource are the same in all
* regions. To prevent duplicate configuration items, you should consider
* customizing AWS Config in only one region to record global resources.
*
*
* @param includeGlobalResourceTypes
* Specifies whether AWS Config includes all supported types of
* global resources (for example, IAM resources) with the resources
* that it records.
*
* Before you can set this option to true
, you must set
* the allSupported
option to true
.
*
*
* If you set this option to true
, when AWS Config adds
* support for a new type of global resource, it automatically starts
* recording resources of that type.
*
*
* The configuration details for any global resource are the same in
* all regions. To prevent duplicate configuration items, you should
* consider customizing AWS Config in only one region to record
* global resources.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RecordingGroup withIncludeGlobalResourceTypes(
Boolean includeGlobalResourceTypes) {
setIncludeGlobalResourceTypes(includeGlobalResourceTypes);
return this;
}
/**
*
* Specifies whether AWS Config includes all supported types of global
* resources (for example, IAM resources) with the resources that it
* records.
*
*
* Before you can set this option to true
, you must set the
* allSupported
option to true
.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of global resource, it automatically starts recording
* resources of that type.
*
*
* The configuration details for any global resource are the same in all
* regions. To prevent duplicate configuration items, you should consider
* customizing AWS Config in only one region to record global resources.
*
*
* @return Specifies whether AWS Config includes all supported types of
* global resources (for example, IAM resources) with the resources
* that it records.
*
* Before you can set this option to true
, you must set
* the allSupported
option to true
.
*
*
* If you set this option to true
, when AWS Config adds
* support for a new type of global resource, it automatically
* starts recording resources of that type.
*
*
* The configuration details for any global resource are the same in
* all regions. To prevent duplicate configuration items, you should
* consider customizing AWS Config in only one region to record
* global resources.
*/
public Boolean isIncludeGlobalResourceTypes() {
return this.includeGlobalResourceTypes;
}
/**
*
* A comma-separated list that specifies the types of AWS resources for
* which AWS Config records configuration changes (for example,
* AWS::EC2::Instance
or AWS::CloudTrail::Trail
).
*
*
* Before you can set this option to true
, you must set the
* allSupported
option to false
.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of resource, it will not record resources of that type
* unless you manually add that type to your recording group.
*
*
* For a list of valid resourceTypes
values, see the
* resourceType Value column in Supported AWS Resource Types.
*
*
* @return A comma-separated list that specifies the types of AWS resources
* for which AWS Config records configuration changes (for example,
* AWS::EC2::Instance
or
* AWS::CloudTrail::Trail
).
*
* Before you can set this option to true
, you must set
* the allSupported
option to false
.
*
*
* If you set this option to true
, when AWS Config adds
* support for a new type of resource, it will not record resources
* of that type unless you manually add that type to your recording
* group.
*
*
* For a list of valid resourceTypes
values, see the
* resourceType Value column in Supported AWS Resource Types.
* @see ResourceType
*/
public java.util.List getResourceTypes() {
if (resourceTypes == null) {
resourceTypes = new com.amazonaws.internal.SdkInternalList();
}
return resourceTypes;
}
/**
*
* A comma-separated list that specifies the types of AWS resources for
* which AWS Config records configuration changes (for example,
* AWS::EC2::Instance
or AWS::CloudTrail::Trail
).
*
*
* Before you can set this option to true
, you must set the
* allSupported
option to false
.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of resource, it will not record resources of that type
* unless you manually add that type to your recording group.
*
*
* For a list of valid resourceTypes
values, see the
* resourceType Value column in Supported AWS Resource Types.
*
*
* @param resourceTypes
* A comma-separated list that specifies the types of AWS resources
* for which AWS Config records configuration changes (for example,
* AWS::EC2::Instance
or
* AWS::CloudTrail::Trail
).
*
* Before you can set this option to true
, you must set
* the allSupported
option to false
.
*
*
* If you set this option to true
, when AWS Config adds
* support for a new type of resource, it will not record resources
* of that type unless you manually add that type to your recording
* group.
*
*
* For a list of valid resourceTypes
values, see the
* resourceType Value column in Supported AWS Resource Types.
* @see ResourceType
*/
public void setResourceTypes(java.util.Collection resourceTypes) {
if (resourceTypes == null) {
this.resourceTypes = null;
return;
}
this.resourceTypes = new com.amazonaws.internal.SdkInternalList(
resourceTypes);
}
/**
*
* A comma-separated list that specifies the types of AWS resources for
* which AWS Config records configuration changes (for example,
* AWS::EC2::Instance
or AWS::CloudTrail::Trail
).
*
*
* Before you can set this option to true
, you must set the
* allSupported
option to false
.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of resource, it will not record resources of that type
* unless you manually add that type to your recording group.
*
*
* For a list of valid resourceTypes
values, see the
* resourceType Value column in Supported AWS Resource Types.
*
*
* NOTE: This method appends the values to the existing list (if
* any). Use {@link #setResourceTypes(java.util.Collection)} or
* {@link #withResourceTypes(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param resourceTypes
* A comma-separated list that specifies the types of AWS resources
* for which AWS Config records configuration changes (for example,
* AWS::EC2::Instance
or
* AWS::CloudTrail::Trail
).
*
* Before you can set this option to true
, you must set
* the allSupported
option to false
.
*
*
* If you set this option to true
, when AWS Config adds
* support for a new type of resource, it will not record resources
* of that type unless you manually add that type to your recording
* group.
*
*
* For a list of valid resourceTypes
values, see the
* resourceType Value column in Supported AWS Resource Types.
* @return Returns a reference to this object so that method calls can be
* chained together.
* @see ResourceType
*/
public RecordingGroup withResourceTypes(String... resourceTypes) {
if (this.resourceTypes == null) {
setResourceTypes(new com.amazonaws.internal.SdkInternalList(
resourceTypes.length));
}
for (String ele : resourceTypes) {
this.resourceTypes.add(ele);
}
return this;
}
/**
*
* A comma-separated list that specifies the types of AWS resources for
* which AWS Config records configuration changes (for example,
* AWS::EC2::Instance
or AWS::CloudTrail::Trail
).
*
*
* Before you can set this option to true
, you must set the
* allSupported
option to false
.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of resource, it will not record resources of that type
* unless you manually add that type to your recording group.
*
*
* For a list of valid resourceTypes
values, see the
* resourceType Value column in Supported AWS Resource Types.
*
*
* @param resourceTypes
* A comma-separated list that specifies the types of AWS resources
* for which AWS Config records configuration changes (for example,
* AWS::EC2::Instance
or
* AWS::CloudTrail::Trail
).
*
* Before you can set this option to true
, you must set
* the allSupported
option to false
.
*
*
* If you set this option to true
, when AWS Config adds
* support for a new type of resource, it will not record resources
* of that type unless you manually add that type to your recording
* group.
*
*
* For a list of valid resourceTypes
values, see the
* resourceType Value column in Supported AWS Resource Types.
* @return Returns a reference to this object so that method calls can be
* chained together.
* @see ResourceType
*/
public RecordingGroup withResourceTypes(
java.util.Collection resourceTypes) {
setResourceTypes(resourceTypes);
return this;
}
/**
*
* A comma-separated list that specifies the types of AWS resources for
* which AWS Config records configuration changes (for example,
* AWS::EC2::Instance
or AWS::CloudTrail::Trail
).
*
*
* Before you can set this option to true
, you must set the
* allSupported
option to false
.
*
*
* If you set this option to true
, when AWS Config adds support
* for a new type of resource, it will not record resources of that type
* unless you manually add that type to your recording group.
*
*
* For a list of valid resourceTypes
values, see the
* resourceType Value column in Supported AWS Resource Types.
*
*
* @param resourceTypes
* A comma-separated list that specifies the types of AWS resources
* for which AWS Config records configuration changes (for example,
* AWS::EC2::Instance
or
* AWS::CloudTrail::Trail
).
*
* Before you can set this option to true
, you must set
* the allSupported
option to false
.
*
*
* If you set this option to true
, when AWS Config adds
* support for a new type of resource, it will not record resources
* of that type unless you manually add that type to your recording
* group.
*
*
* For a list of valid resourceTypes
values, see the
* resourceType Value column in Supported AWS Resource Types.
* @return Returns a reference to this object so that method calls can be
* chained together.
* @see ResourceType
*/
public RecordingGroup withResourceTypes(ResourceType... resourceTypes) {
com.amazonaws.internal.SdkInternalList resourceTypesCopy = new com.amazonaws.internal.SdkInternalList(
resourceTypes.length);
for (ResourceType value : resourceTypes) {
resourceTypesCopy.add(value.toString());
}
if (getResourceTypes() == null) {
setResourceTypes(resourceTypesCopy);
} else {
getResourceTypes().addAll(resourceTypesCopy);
}
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAllSupported() != null)
sb.append("AllSupported: " + getAllSupported() + ",");
if (getIncludeGlobalResourceTypes() != null)
sb.append("IncludeGlobalResourceTypes: "
+ getIncludeGlobalResourceTypes() + ",");
if (getResourceTypes() != null)
sb.append("ResourceTypes: " + getResourceTypes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RecordingGroup == false)
return false;
RecordingGroup other = (RecordingGroup) obj;
if (other.getAllSupported() == null ^ this.getAllSupported() == null)
return false;
if (other.getAllSupported() != null
&& other.getAllSupported().equals(this.getAllSupported()) == false)
return false;
if (other.getIncludeGlobalResourceTypes() == null
^ this.getIncludeGlobalResourceTypes() == null)
return false;
if (other.getIncludeGlobalResourceTypes() != null
&& other.getIncludeGlobalResourceTypes().equals(
this.getIncludeGlobalResourceTypes()) == false)
return false;
if (other.getResourceTypes() == null ^ this.getResourceTypes() == null)
return false;
if (other.getResourceTypes() != null
&& other.getResourceTypes().equals(this.getResourceTypes()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime
* hashCode
+ ((getAllSupported() == null) ? 0 : getAllSupported()
.hashCode());
hashCode = prime
* hashCode
+ ((getIncludeGlobalResourceTypes() == null) ? 0
: getIncludeGlobalResourceTypes().hashCode());
hashCode = prime
* hashCode
+ ((getResourceTypes() == null) ? 0 : getResourceTypes()
.hashCode());
return hashCode;
}
@Override
public RecordingGroup clone() {
try {
return (RecordingGroup) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!", e);
}
}
}