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

software.amazon.awssdk.services.cloudwatchlogs.model.LogGroup Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.cloudwatchlogs.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;

/**
 * 

* Represents a log group. *

*/ @Generated("software.amazon.awssdk:codegen") public final class LogGroup implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField LOG_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("logGroupName").getter(getter(LogGroup::logGroupName)).setter(setter(Builder::logGroupName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("logGroupName").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("creationTime").getter(getter(LogGroup::creationTime)).setter(setter(Builder::creationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationTime").build()).build(); private static final SdkField RETENTION_IN_DAYS_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("retentionInDays").getter(getter(LogGroup::retentionInDays)).setter(setter(Builder::retentionInDays)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("retentionInDays").build()).build(); private static final SdkField METRIC_FILTER_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("metricFilterCount").getter(getter(LogGroup::metricFilterCount)) .setter(setter(Builder::metricFilterCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("metricFilterCount").build()).build(); private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn") .getter(getter(LogGroup::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField STORED_BYTES_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("storedBytes").getter(getter(LogGroup::storedBytes)).setter(setter(Builder::storedBytes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("storedBytes").build()).build(); private static final SdkField KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("kmsKeyId").getter(getter(LogGroup::kmsKeyId)).setter(setter(Builder::kmsKeyId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kmsKeyId").build()).build(); private static final SdkField DATA_PROTECTION_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("dataProtectionStatus").getter(getter(LogGroup::dataProtectionStatusAsString)) .setter(setter(Builder::dataProtectionStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dataProtectionStatus").build()) .build(); private static final SdkField> INHERITED_PROPERTIES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("inheritedProperties") .getter(getter(LogGroup::inheritedPropertiesAsStrings)) .setter(setter(Builder::inheritedPropertiesWithStrings)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("inheritedProperties").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 LOG_GROUP_CLASS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("logGroupClass").getter(getter(LogGroup::logGroupClassAsString)).setter(setter(Builder::logGroupClass)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("logGroupClass").build()).build(); private static final SdkField LOG_GROUP_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("logGroupArn").getter(getter(LogGroup::logGroupArn)).setter(setter(Builder::logGroupArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("logGroupArn").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LOG_GROUP_NAME_FIELD, CREATION_TIME_FIELD, RETENTION_IN_DAYS_FIELD, METRIC_FILTER_COUNT_FIELD, ARN_FIELD, STORED_BYTES_FIELD, KMS_KEY_ID_FIELD, DATA_PROTECTION_STATUS_FIELD, INHERITED_PROPERTIES_FIELD, LOG_GROUP_CLASS_FIELD, LOG_GROUP_ARN_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String logGroupName; private final Long creationTime; private final Integer retentionInDays; private final Integer metricFilterCount; private final String arn; private final Long storedBytes; private final String kmsKeyId; private final String dataProtectionStatus; private final List inheritedProperties; private final String logGroupClass; private final String logGroupArn; private LogGroup(BuilderImpl builder) { this.logGroupName = builder.logGroupName; this.creationTime = builder.creationTime; this.retentionInDays = builder.retentionInDays; this.metricFilterCount = builder.metricFilterCount; this.arn = builder.arn; this.storedBytes = builder.storedBytes; this.kmsKeyId = builder.kmsKeyId; this.dataProtectionStatus = builder.dataProtectionStatus; this.inheritedProperties = builder.inheritedProperties; this.logGroupClass = builder.logGroupClass; this.logGroupArn = builder.logGroupArn; } /** *

* The name of the log group. *

* * @return The name of the log group. */ public final String logGroupName() { return logGroupName; } /** *

* The creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. *

* * @return The creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 * UTC. */ public final Long creationTime() { return creationTime; } /** * Returns the value of the RetentionInDays property for this object. * * @return The value of the RetentionInDays property for this object. */ public final Integer retentionInDays() { return retentionInDays; } /** *

* The number of metric filters. *

* * @return The number of metric filters. */ public final Integer metricFilterCount() { return metricFilterCount; } /** *

* The Amazon Resource Name (ARN) of the log group. This version of the ARN includes a trailing :* * after the log group name. *

*

* Use this version to refer to the ARN in IAM policies when specifying permissions for most API actions. The * exception is when specifying permissions for TagResource, * * UntagResource, and ListTagsForResource. The permissions for those three actions require the ARN version that doesn't include a * trailing :*. *

* * @return The Amazon Resource Name (ARN) of the log group. This version of the ARN includes a trailing * :* after the log group name.

*

* Use this version to refer to the ARN in IAM policies when specifying permissions for most API actions. * The exception is when specifying permissions for TagResource, UntagResource, and ListTagsForResource. The permissions for those three actions require the ARN version that doesn't * include a trailing :*. */ public final String arn() { return arn; } /** *

* The number of bytes stored. *

* * @return The number of bytes stored. */ public final Long storedBytes() { return storedBytes; } /** *

* The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. *

* * @return The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. */ public final String kmsKeyId() { return kmsKeyId; } /** *

* Displays whether this log group has a protection policy, or whether it had one in the past. For more information, * see PutDataProtectionPolicy. *

*

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

* * @return Displays whether this log group has a protection policy, or whether it had one in the past. For more * information, see PutDataProtectionPolicy. * @see DataProtectionStatus */ public final DataProtectionStatus dataProtectionStatus() { return DataProtectionStatus.fromValue(dataProtectionStatus); } /** *

* Displays whether this log group has a protection policy, or whether it had one in the past. For more information, * see PutDataProtectionPolicy. *

*

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

* * @return Displays whether this log group has a protection policy, or whether it had one in the past. For more * information, see PutDataProtectionPolicy. * @see DataProtectionStatus */ public final String dataProtectionStatusAsString() { return dataProtectionStatus; } /** *

* Displays all the properties that this log group has inherited from account-level settings. *

*

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

* * @return Displays all the properties that this log group has inherited from account-level settings. */ public final List inheritedProperties() { return InheritedPropertiesCopier.copyStringToEnum(inheritedProperties); } /** * For responses, this returns true if the service returned a value for the InheritedProperties 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 hasInheritedProperties() { return inheritedProperties != null && !(inheritedProperties instanceof SdkAutoConstructList); } /** *

* Displays all the properties that this log group has inherited from account-level settings. *

*

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

* * @return Displays all the properties that this log group has inherited from account-level settings. */ public final List inheritedPropertiesAsStrings() { return inheritedProperties; } /** *

* This specifies the log group class for this log group. There are two classes: *

*
    *
  • *

    * The Standard log class supports all CloudWatch Logs features. *

    *
  • *
  • *

    * The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs lower * costs. *

    *
  • *
*

* For details about the features supported by each class, see Log classes *

*

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

* * @return This specifies the log group class for this log group. There are two classes:

*
    *
  • *

    * The Standard log class supports all CloudWatch Logs features. *

    *
  • *
  • *

    * The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs * lower costs. *

    *
  • *
*

* For details about the features supported by each class, see Log * classes * @see LogGroupClass */ public final LogGroupClass logGroupClass() { return LogGroupClass.fromValue(logGroupClass); } /** *

* This specifies the log group class for this log group. There are two classes: *

*
    *
  • *

    * The Standard log class supports all CloudWatch Logs features. *

    *
  • *
  • *

    * The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs lower * costs. *

    *
  • *
*

* For details about the features supported by each class, see Log classes *

*

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

* * @return This specifies the log group class for this log group. There are two classes:

*
    *
  • *

    * The Standard log class supports all CloudWatch Logs features. *

    *
  • *
  • *

    * The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs * lower costs. *

    *
  • *
*

* For details about the features supported by each class, see Log * classes * @see LogGroupClass */ public final String logGroupClassAsString() { return logGroupClass; } /** *

* The Amazon Resource Name (ARN) of the log group. This version of the ARN doesn't include a trailing * :* after the log group name. *

*

* Use this version to refer to the ARN in the following situations: *

*
    *
  • *

    * In the logGroupIdentifier input field in many CloudWatch Logs APIs. *

    *
  • *
  • *

    * In the resourceArn field in tagging APIs *

    *
  • *
  • *

    * In IAM policies, when specifying permissions for TagResource, * * UntagResource, and ListTagsForResource. *

    *
  • *
* * @return The Amazon Resource Name (ARN) of the log group. This version of the ARN doesn't include a trailing * :* after the log group name.

*

* Use this version to refer to the ARN in the following situations: *

*
    *
  • *

    * In the logGroupIdentifier input field in many CloudWatch Logs APIs. *

    *
  • *
  • *

    * In the resourceArn field in tagging APIs *

    *
  • *
  • *

    * In IAM policies, when specifying permissions for TagResource, UntagResource, and ListTagsForResource. *

    *
  • */ public final String logGroupArn() { return logGroupArn; } @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(logGroupName()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(retentionInDays()); hashCode = 31 * hashCode + Objects.hashCode(metricFilterCount()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(storedBytes()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId()); hashCode = 31 * hashCode + Objects.hashCode(dataProtectionStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasInheritedProperties() ? inheritedPropertiesAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(logGroupClassAsString()); hashCode = 31 * hashCode + Objects.hashCode(logGroupArn()); 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 LogGroup)) { return false; } LogGroup other = (LogGroup) obj; return Objects.equals(logGroupName(), other.logGroupName()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(retentionInDays(), other.retentionInDays()) && Objects.equals(metricFilterCount(), other.metricFilterCount()) && Objects.equals(arn(), other.arn()) && Objects.equals(storedBytes(), other.storedBytes()) && Objects.equals(kmsKeyId(), other.kmsKeyId()) && Objects.equals(dataProtectionStatusAsString(), other.dataProtectionStatusAsString()) && hasInheritedProperties() == other.hasInheritedProperties() && Objects.equals(inheritedPropertiesAsStrings(), other.inheritedPropertiesAsStrings()) && Objects.equals(logGroupClassAsString(), other.logGroupClassAsString()) && Objects.equals(logGroupArn(), other.logGroupArn()); } /** * 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("LogGroup").add("LogGroupName", logGroupName()).add("CreationTime", creationTime()) .add("RetentionInDays", retentionInDays()).add("MetricFilterCount", metricFilterCount()).add("Arn", arn()) .add("StoredBytes", storedBytes()).add("KmsKeyId", kmsKeyId()) .add("DataProtectionStatus", dataProtectionStatusAsString()) .add("InheritedProperties", hasInheritedProperties() ? inheritedPropertiesAsStrings() : null) .add("LogGroupClass", logGroupClassAsString()).add("LogGroupArn", logGroupArn()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "logGroupName": return Optional.ofNullable(clazz.cast(logGroupName())); case "creationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "retentionInDays": return Optional.ofNullable(clazz.cast(retentionInDays())); case "metricFilterCount": return Optional.ofNullable(clazz.cast(metricFilterCount())); case "arn": return Optional.ofNullable(clazz.cast(arn())); case "storedBytes": return Optional.ofNullable(clazz.cast(storedBytes())); case "kmsKeyId": return Optional.ofNullable(clazz.cast(kmsKeyId())); case "dataProtectionStatus": return Optional.ofNullable(clazz.cast(dataProtectionStatusAsString())); case "inheritedProperties": return Optional.ofNullable(clazz.cast(inheritedPropertiesAsStrings())); case "logGroupClass": return Optional.ofNullable(clazz.cast(logGroupClassAsString())); case "logGroupArn": return Optional.ofNullable(clazz.cast(logGroupArn())); 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("logGroupName", LOG_GROUP_NAME_FIELD); map.put("creationTime", CREATION_TIME_FIELD); map.put("retentionInDays", RETENTION_IN_DAYS_FIELD); map.put("metricFilterCount", METRIC_FILTER_COUNT_FIELD); map.put("arn", ARN_FIELD); map.put("storedBytes", STORED_BYTES_FIELD); map.put("kmsKeyId", KMS_KEY_ID_FIELD); map.put("dataProtectionStatus", DATA_PROTECTION_STATUS_FIELD); map.put("inheritedProperties", INHERITED_PROPERTIES_FIELD); map.put("logGroupClass", LOG_GROUP_CLASS_FIELD); map.put("logGroupArn", LOG_GROUP_ARN_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((LogGroup) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * The name of the log group. *

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

    * The creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. *

    * * @param creationTime * The creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 * UTC. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Long creationTime); /** * Sets the value of the RetentionInDays property for this object. * * @param retentionInDays * The new value for the RetentionInDays property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder retentionInDays(Integer retentionInDays); /** *

    * The number of metric filters. *

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

    * The Amazon Resource Name (ARN) of the log group. This version of the ARN includes a trailing :* * after the log group name. *

    *

    * Use this version to refer to the ARN in IAM policies when specifying permissions for most API actions. The * exception is when specifying permissions for TagResource, UntagResource, and ListTagsForResource. The permissions for those three actions require the ARN version that doesn't * include a trailing :*. *

    * * @param arn * The Amazon Resource Name (ARN) of the log group. This version of the ARN includes a trailing * :* after the log group name.

    *

    * Use this version to refer to the ARN in IAM policies when specifying permissions for most API actions. * The exception is when specifying permissions for TagResource, UntagResource, and ListTagsForResource. The permissions for those three actions require the ARN version that doesn't * include a trailing :*. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

    * The number of bytes stored. *

    * * @param storedBytes * The number of bytes stored. * @return Returns a reference to this object so that method calls can be chained together. */ Builder storedBytes(Long storedBytes); /** *

    * The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. *

    * * @param kmsKeyId * The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyId(String kmsKeyId); /** *

    * Displays whether this log group has a protection policy, or whether it had one in the past. For more * information, see PutDataProtectionPolicy. *

    * * @param dataProtectionStatus * Displays whether this log group has a protection policy, or whether it had one in the past. For more * information, see PutDataProtectionPolicy. * @see DataProtectionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see DataProtectionStatus */ Builder dataProtectionStatus(String dataProtectionStatus); /** *

    * Displays whether this log group has a protection policy, or whether it had one in the past. For more * information, see PutDataProtectionPolicy. *

    * * @param dataProtectionStatus * Displays whether this log group has a protection policy, or whether it had one in the past. For more * information, see PutDataProtectionPolicy. * @see DataProtectionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see DataProtectionStatus */ Builder dataProtectionStatus(DataProtectionStatus dataProtectionStatus); /** *

    * Displays all the properties that this log group has inherited from account-level settings. *

    * * @param inheritedProperties * Displays all the properties that this log group has inherited from account-level settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inheritedPropertiesWithStrings(Collection inheritedProperties); /** *

    * Displays all the properties that this log group has inherited from account-level settings. *

    * * @param inheritedProperties * Displays all the properties that this log group has inherited from account-level settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inheritedPropertiesWithStrings(String... inheritedProperties); /** *

    * Displays all the properties that this log group has inherited from account-level settings. *

    * * @param inheritedProperties * Displays all the properties that this log group has inherited from account-level settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inheritedProperties(Collection inheritedProperties); /** *

    * Displays all the properties that this log group has inherited from account-level settings. *

    * * @param inheritedProperties * Displays all the properties that this log group has inherited from account-level settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inheritedProperties(InheritedProperty... inheritedProperties); /** *

    * This specifies the log group class for this log group. There are two classes: *

    *
      *
    • *

      * The Standard log class supports all CloudWatch Logs features. *

      *
    • *
    • *

      * The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs lower * costs. *

      *
    • *
    *

    * For details about the features supported by each class, see Log * classes *

    * * @param logGroupClass * This specifies the log group class for this log group. There are two classes:

    *
      *
    • *

      * The Standard log class supports all CloudWatch Logs features. *

      *
    • *
    • *

      * The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs * lower costs. *

      *
    • *
    *

    * For details about the features supported by each class, see Log * classes * @see LogGroupClass * @return Returns a reference to this object so that method calls can be chained together. * @see LogGroupClass */ Builder logGroupClass(String logGroupClass); /** *

    * This specifies the log group class for this log group. There are two classes: *

    *
      *
    • *

      * The Standard log class supports all CloudWatch Logs features. *

      *
    • *
    • *

      * The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs lower * costs. *

      *
    • *
    *

    * For details about the features supported by each class, see Log * classes *

    * * @param logGroupClass * This specifies the log group class for this log group. There are two classes:

    *
      *
    • *

      * The Standard log class supports all CloudWatch Logs features. *

      *
    • *
    • *

      * The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs * lower costs. *

      *
    • *
    *

    * For details about the features supported by each class, see Log * classes * @see LogGroupClass * @return Returns a reference to this object so that method calls can be chained together. * @see LogGroupClass */ Builder logGroupClass(LogGroupClass logGroupClass); /** *

    * The Amazon Resource Name (ARN) of the log group. This version of the ARN doesn't include a trailing * :* after the log group name. *

    *

    * Use this version to refer to the ARN in the following situations: *

    *
      *
    • *

      * In the logGroupIdentifier input field in many CloudWatch Logs APIs. *

      *
    • *
    • *

      * In the resourceArn field in tagging APIs *

      *
    • *
    • *

      * In IAM policies, when specifying permissions for TagResource, UntagResource, and ListTagsForResource. *

      *
    • *
    * * @param logGroupArn * The Amazon Resource Name (ARN) of the log group. This version of the ARN doesn't include a trailing * :* after the log group name.

    *

    * Use this version to refer to the ARN in the following situations: *

    *
      *
    • *

      * In the logGroupIdentifier input field in many CloudWatch Logs APIs. *

      *
    • *
    • *

      * In the resourceArn field in tagging APIs *

      *
    • *
    • *

      * In IAM policies, when specifying permissions for TagResource, UntagResource, and ListTagsForResource. *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder logGroupArn(String logGroupArn); } static final class BuilderImpl implements Builder { private String logGroupName; private Long creationTime; private Integer retentionInDays; private Integer metricFilterCount; private String arn; private Long storedBytes; private String kmsKeyId; private String dataProtectionStatus; private List inheritedProperties = DefaultSdkAutoConstructList.getInstance(); private String logGroupClass; private String logGroupArn; private BuilderImpl() { } private BuilderImpl(LogGroup model) { logGroupName(model.logGroupName); creationTime(model.creationTime); retentionInDays(model.retentionInDays); metricFilterCount(model.metricFilterCount); arn(model.arn); storedBytes(model.storedBytes); kmsKeyId(model.kmsKeyId); dataProtectionStatus(model.dataProtectionStatus); inheritedPropertiesWithStrings(model.inheritedProperties); logGroupClass(model.logGroupClass); logGroupArn(model.logGroupArn); } public final String getLogGroupName() { return logGroupName; } public final void setLogGroupName(String logGroupName) { this.logGroupName = logGroupName; } @Override public final Builder logGroupName(String logGroupName) { this.logGroupName = logGroupName; return this; } public final Long getCreationTime() { return creationTime; } public final void setCreationTime(Long creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(Long creationTime) { this.creationTime = creationTime; return this; } public final Integer getRetentionInDays() { return retentionInDays; } public final void setRetentionInDays(Integer retentionInDays) { this.retentionInDays = retentionInDays; } @Override public final Builder retentionInDays(Integer retentionInDays) { this.retentionInDays = retentionInDays; return this; } public final Integer getMetricFilterCount() { return metricFilterCount; } public final void setMetricFilterCount(Integer metricFilterCount) { this.metricFilterCount = metricFilterCount; } @Override public final Builder metricFilterCount(Integer metricFilterCount) { this.metricFilterCount = metricFilterCount; return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final Long getStoredBytes() { return storedBytes; } public final void setStoredBytes(Long storedBytes) { this.storedBytes = storedBytes; } @Override public final Builder storedBytes(Long storedBytes) { this.storedBytes = storedBytes; return this; } public final String getKmsKeyId() { return kmsKeyId; } public final void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } @Override public final Builder kmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; return this; } public final String getDataProtectionStatus() { return dataProtectionStatus; } public final void setDataProtectionStatus(String dataProtectionStatus) { this.dataProtectionStatus = dataProtectionStatus; } @Override public final Builder dataProtectionStatus(String dataProtectionStatus) { this.dataProtectionStatus = dataProtectionStatus; return this; } @Override public final Builder dataProtectionStatus(DataProtectionStatus dataProtectionStatus) { this.dataProtectionStatus(dataProtectionStatus == null ? null : dataProtectionStatus.toString()); return this; } public final Collection getInheritedProperties() { if (inheritedProperties instanceof SdkAutoConstructList) { return null; } return inheritedProperties; } public final void setInheritedProperties(Collection inheritedProperties) { this.inheritedProperties = InheritedPropertiesCopier.copy(inheritedProperties); } @Override public final Builder inheritedPropertiesWithStrings(Collection inheritedProperties) { this.inheritedProperties = InheritedPropertiesCopier.copy(inheritedProperties); return this; } @Override @SafeVarargs public final Builder inheritedPropertiesWithStrings(String... inheritedProperties) { inheritedPropertiesWithStrings(Arrays.asList(inheritedProperties)); return this; } @Override public final Builder inheritedProperties(Collection inheritedProperties) { this.inheritedProperties = InheritedPropertiesCopier.copyEnumToString(inheritedProperties); return this; } @Override @SafeVarargs public final Builder inheritedProperties(InheritedProperty... inheritedProperties) { inheritedProperties(Arrays.asList(inheritedProperties)); return this; } public final String getLogGroupClass() { return logGroupClass; } public final void setLogGroupClass(String logGroupClass) { this.logGroupClass = logGroupClass; } @Override public final Builder logGroupClass(String logGroupClass) { this.logGroupClass = logGroupClass; return this; } @Override public final Builder logGroupClass(LogGroupClass logGroupClass) { this.logGroupClass(logGroupClass == null ? null : logGroupClass.toString()); return this; } public final String getLogGroupArn() { return logGroupArn; } public final void setLogGroupArn(String logGroupArn) { this.logGroupArn = logGroupArn; } @Override public final Builder logGroupArn(String logGroupArn) { this.logGroupArn = logGroupArn; return this; } @Override public LogGroup build() { return new LogGroup(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy