Class CreateRuleRequest
- java.lang.Object
-
- software.amazon.awssdk.core.SdkRequest
-
- software.amazon.awssdk.awscore.AwsRequest
-
- software.amazon.awssdk.services.rbin.model.RbinRequest
-
- software.amazon.awssdk.services.rbin.model.CreateRuleRequest
-
- All Implemented Interfaces:
SdkPojo,ToCopyableBuilder<CreateRuleRequest.Builder,CreateRuleRequest>
@Generated("software.amazon.awssdk:codegen") public final class CreateRuleRequest extends RbinRequest implements ToCopyableBuilder<CreateRuleRequest.Builder,CreateRuleRequest>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCreateRuleRequest.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CreateRuleRequest.Builderbuilder()Stringdescription()The retention rule description.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()booleanhasResourceTags()For responses, this returns true if the service returned a value for the ResourceTags property.booleanhasTags()For responses, this returns true if the service returned a value for the Tags property.LockConfigurationlockConfiguration()Information about the retention rule lock configuration.List<ResourceTag>resourceTags()Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule.ResourceTyperesourceType()The resource type to be retained by the retention rule.StringresourceTypeAsString()The resource type to be retained by the retention rule.RetentionPeriodretentionPeriod()Information about the retention period for which the retention rule is to retain resources.List<SdkField<?>>sdkFields()static Class<? extends CreateRuleRequest.Builder>serializableBuilderClass()List<Tag>tags()Information about the tags to assign to the retention rule.CreateRuleRequest.BuildertoBuilder()StringtoString()Returns a string representation of this object.-
Methods inherited from class software.amazon.awssdk.awscore.AwsRequest
overrideConfiguration
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
retentionPeriod
public final RetentionPeriod retentionPeriod()
Information about the retention period for which the retention rule is to retain resources.
- Returns:
- Information about the retention period for which the retention rule is to retain resources.
-
description
public final String description()
The retention rule description.
- Returns:
- The retention rule description.
-
hasTags
public final boolean hasTags()
For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()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.
-
tags
public final List<Tag> tags()
Information about the tags to assign to the retention rule.
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
hasTags()method.- Returns:
- Information about the tags to assign to the retention rule.
-
resourceType
public final ResourceType resourceType()
The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, specify
EBS_SNAPSHOT. To retain EBS-backed AMIs, specifyEC2_IMAGE.If the service returns an enum value that is not available in the current SDK version,
resourceTypewill returnResourceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromresourceTypeAsString().- Returns:
- The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots and
EBS-backed AMIs are supported. To retain snapshots, specify
EBS_SNAPSHOT. To retain EBS-backed AMIs, specifyEC2_IMAGE. - See Also:
ResourceType
-
resourceTypeAsString
public final String resourceTypeAsString()
The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, specify
EBS_SNAPSHOT. To retain EBS-backed AMIs, specifyEC2_IMAGE.If the service returns an enum value that is not available in the current SDK version,
resourceTypewill returnResourceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromresourceTypeAsString().- Returns:
- The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots and
EBS-backed AMIs are supported. To retain snapshots, specify
EBS_SNAPSHOT. To retain EBS-backed AMIs, specifyEC2_IMAGE. - See Also:
ResourceType
-
hasResourceTags
public final boolean hasResourceTags()
For responses, this returns true if the service returned a value for the ResourceTags property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()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.
-
resourceTags
public final List<ResourceTag> resourceTags()
Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule.
You can add the same tag key and value pair to a maximum or five retention rules.
To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged.
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
hasResourceTags()method.- Returns:
- Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention
rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have
one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does
not have any of the specified tag key and value pairs, it is immediately deleted without being retained
by the retention rule.
You can add the same tag key and value pair to a maximum or five retention rules.
To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged.
-
lockConfiguration
public final LockConfiguration lockConfiguration()
Information about the retention rule lock configuration.
- Returns:
- Information about the retention rule lock configuration.
-
toBuilder
public CreateRuleRequest.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<CreateRuleRequest.Builder,CreateRuleRequest>- Specified by:
toBuilderin classRbinRequest
-
builder
public static CreateRuleRequest.Builder builder()
-
serializableBuilderClass
public static Class<? extends CreateRuleRequest.Builder> serializableBuilderClass()
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classAwsRequest
-
equals
public final boolean equals(Object obj)
- Overrides:
equalsin classAwsRequest
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String toString()
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.
-
getValueForField
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
- Overrides:
getValueForFieldin classSdkRequest
-
-