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

software.amazon.awssdk.services.route53resolver.model.ResolverQueryLogConfigAssociation 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.route53resolver.model;

import java.io.Serializable;
import java.util.Arrays;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* In the response to an AssociateResolverQueryLogConfig, DisassociateResolverQueryLogConfig, GetResolverQueryLogConfigAssociation, or ListResolverQueryLogConfigAssociations, request, a complex type that contains settings for a specified * association between an Amazon VPC and a query logging configuration. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ResolverQueryLogConfigAssociation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id") .getter(getter(ResolverQueryLogConfigAssociation::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build(); private static final SdkField RESOLVER_QUERY_LOG_CONFIG_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ResolverQueryLogConfigId").getter(getter(ResolverQueryLogConfigAssociation::resolverQueryLogConfigId)) .setter(setter(Builder::resolverQueryLogConfigId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResolverQueryLogConfigId").build()) .build(); private static final SdkField RESOURCE_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ResourceId").getter(getter(ResolverQueryLogConfigAssociation::resourceId)) .setter(setter(Builder::resourceId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceId").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(ResolverQueryLogConfigAssociation::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField ERROR_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Error") .getter(getter(ResolverQueryLogConfigAssociation::errorAsString)).setter(setter(Builder::error)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Error").build()).build(); private static final SdkField ERROR_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ErrorMessage").getter(getter(ResolverQueryLogConfigAssociation::errorMessage)) .setter(setter(Builder::errorMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ErrorMessage").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CreationTime").getter(getter(ResolverQueryLogConfigAssociation::creationTime)) .setter(setter(Builder::creationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, RESOLVER_QUERY_LOG_CONFIG_ID_FIELD, RESOURCE_ID_FIELD, STATUS_FIELD, ERROR_FIELD, ERROR_MESSAGE_FIELD, CREATION_TIME_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String id; private final String resolverQueryLogConfigId; private final String resourceId; private final String status; private final String error; private final String errorMessage; private final String creationTime; private ResolverQueryLogConfigAssociation(BuilderImpl builder) { this.id = builder.id; this.resolverQueryLogConfigId = builder.resolverQueryLogConfigId; this.resourceId = builder.resourceId; this.status = builder.status; this.error = builder.error; this.errorMessage = builder.errorMessage; this.creationTime = builder.creationTime; } /** *

* The ID of the query logging association. *

* * @return The ID of the query logging association. */ public final String id() { return id; } /** *

* The ID of the query logging configuration that a VPC is associated with. *

* * @return The ID of the query logging configuration that a VPC is associated with. */ public final String resolverQueryLogConfigId() { return resolverQueryLogConfigId; } /** *

* The ID of the Amazon VPC that is associated with the query logging configuration. *

* * @return The ID of the Amazon VPC that is associated with the query logging configuration. */ public final String resourceId() { return resourceId; } /** *

* The status of the specified query logging association. Valid values include the following: *

*
    *
  • *

    * CREATING: Resolver is creating an association between an Amazon VPC and a query logging * configuration. *

    *
  • *
  • *

    * ACTIVE: The association between an Amazon VPC and a query logging configuration was successfully * created. Resolver is logging queries that originate in the specified VPC. *

    *
  • *
  • *

    * DELETING: Resolver is deleting this query logging association. *

    *
  • *
  • *

    * FAILED: Resolver either couldn't create or couldn't delete the query logging association. *

    *
  • *
*

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

* * @return The status of the specified query logging association. Valid values include the following:

*
    *
  • *

    * CREATING: Resolver is creating an association between an Amazon VPC and a query logging * configuration. *

    *
  • *
  • *

    * ACTIVE: The association between an Amazon VPC and a query logging configuration was * successfully created. Resolver is logging queries that originate in the specified VPC. *

    *
  • *
  • *

    * DELETING: Resolver is deleting this query logging association. *

    *
  • *
  • *

    * FAILED: Resolver either couldn't create or couldn't delete the query logging association. *

    *
  • * @see ResolverQueryLogConfigAssociationStatus */ public final ResolverQueryLogConfigAssociationStatus status() { return ResolverQueryLogConfigAssociationStatus.fromValue(status); } /** *

    * The status of the specified query logging association. Valid values include the following: *

    *
      *
    • *

      * CREATING: Resolver is creating an association between an Amazon VPC and a query logging * configuration. *

      *
    • *
    • *

      * ACTIVE: The association between an Amazon VPC and a query logging configuration was successfully * created. Resolver is logging queries that originate in the specified VPC. *

      *
    • *
    • *

      * DELETING: Resolver is deleting this query logging association. *

      *
    • *
    • *

      * FAILED: Resolver either couldn't create or couldn't delete the query logging association. *

      *
    • *
    *

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

    * * @return The status of the specified query logging association. Valid values include the following:

    *
      *
    • *

      * CREATING: Resolver is creating an association between an Amazon VPC and a query logging * configuration. *

      *
    • *
    • *

      * ACTIVE: The association between an Amazon VPC and a query logging configuration was * successfully created. Resolver is logging queries that originate in the specified VPC. *

      *
    • *
    • *

      * DELETING: Resolver is deleting this query logging association. *

      *
    • *
    • *

      * FAILED: Resolver either couldn't create or couldn't delete the query logging association. *

      *
    • * @see ResolverQueryLogConfigAssociationStatus */ public final String statusAsString() { return status; } /** *

      * If the value of Status is FAILED, the value of Error indicates the cause: *

      *
        *
      • *

        * DESTINATION_NOT_FOUND: The specified destination (for example, an Amazon S3 bucket) was deleted. *

        *
      • *
      • *

        * ACCESS_DENIED: Permissions don't allow sending logs to the destination. *

        *
      • *
      *

      * If the value of Status is a value other than FAILED, Error is null. *

      *

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

      * * @return If the value of Status is FAILED, the value of Error indicates the * cause:

      *
        *
      • *

        * DESTINATION_NOT_FOUND: The specified destination (for example, an Amazon S3 bucket) was * deleted. *

        *
      • *
      • *

        * ACCESS_DENIED: Permissions don't allow sending logs to the destination. *

        *
      • *
      *

      * If the value of Status is a value other than FAILED, Error is * null. * @see ResolverQueryLogConfigAssociationError */ public final ResolverQueryLogConfigAssociationError error() { return ResolverQueryLogConfigAssociationError.fromValue(error); } /** *

      * If the value of Status is FAILED, the value of Error indicates the cause: *

      *
        *
      • *

        * DESTINATION_NOT_FOUND: The specified destination (for example, an Amazon S3 bucket) was deleted. *

        *
      • *
      • *

        * ACCESS_DENIED: Permissions don't allow sending logs to the destination. *

        *
      • *
      *

      * If the value of Status is a value other than FAILED, Error is null. *

      *

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

      * * @return If the value of Status is FAILED, the value of Error indicates the * cause:

      *
        *
      • *

        * DESTINATION_NOT_FOUND: The specified destination (for example, an Amazon S3 bucket) was * deleted. *

        *
      • *
      • *

        * ACCESS_DENIED: Permissions don't allow sending logs to the destination. *

        *
      • *
      *

      * If the value of Status is a value other than FAILED, Error is * null. * @see ResolverQueryLogConfigAssociationError */ public final String errorAsString() { return error; } /** *

      * Contains additional information about the error. If the value or Error is null, the value of * ErrorMessage also is null. *

      * * @return Contains additional information about the error. If the value or Error is null, the value of * ErrorMessage also is null. */ public final String errorMessage() { return errorMessage; } /** *

      * The date and time that the VPC was associated with the query logging configuration, in Unix time format and * Coordinated Universal Time (UTC). *

      * * @return The date and time that the VPC was associated with the query logging configuration, in Unix time format * and Coordinated Universal Time (UTC). */ public final String creationTime() { return creationTime; } @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(id()); hashCode = 31 * hashCode + Objects.hashCode(resolverQueryLogConfigId()); hashCode = 31 * hashCode + Objects.hashCode(resourceId()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(errorAsString()); hashCode = 31 * hashCode + Objects.hashCode(errorMessage()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); 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 ResolverQueryLogConfigAssociation)) { return false; } ResolverQueryLogConfigAssociation other = (ResolverQueryLogConfigAssociation) obj; return Objects.equals(id(), other.id()) && Objects.equals(resolverQueryLogConfigId(), other.resolverQueryLogConfigId()) && Objects.equals(resourceId(), other.resourceId()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(errorAsString(), other.errorAsString()) && Objects.equals(errorMessage(), other.errorMessage()) && Objects.equals(creationTime(), other.creationTime()); } /** * 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("ResolverQueryLogConfigAssociation").add("Id", id()) .add("ResolverQueryLogConfigId", resolverQueryLogConfigId()).add("ResourceId", resourceId()) .add("Status", statusAsString()).add("Error", errorAsString()).add("ErrorMessage", errorMessage()) .add("CreationTime", creationTime()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Id": return Optional.ofNullable(clazz.cast(id())); case "ResolverQueryLogConfigId": return Optional.ofNullable(clazz.cast(resolverQueryLogConfigId())); case "ResourceId": return Optional.ofNullable(clazz.cast(resourceId())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "Error": return Optional.ofNullable(clazz.cast(errorAsString())); case "ErrorMessage": return Optional.ofNullable(clazz.cast(errorMessage())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); 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("Id", ID_FIELD); map.put("ResolverQueryLogConfigId", RESOLVER_QUERY_LOG_CONFIG_ID_FIELD); map.put("ResourceId", RESOURCE_ID_FIELD); map.put("Status", STATUS_FIELD); map.put("Error", ERROR_FIELD); map.put("ErrorMessage", ERROR_MESSAGE_FIELD); map.put("CreationTime", CREATION_TIME_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((ResolverQueryLogConfigAssociation) 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 query logging association. *

      * * @param id * The ID of the query logging association. * @return Returns a reference to this object so that method calls can be chained together. */ Builder id(String id); /** *

      * The ID of the query logging configuration that a VPC is associated with. *

      * * @param resolverQueryLogConfigId * The ID of the query logging configuration that a VPC is associated with. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resolverQueryLogConfigId(String resolverQueryLogConfigId); /** *

      * The ID of the Amazon VPC that is associated with the query logging configuration. *

      * * @param resourceId * The ID of the Amazon VPC that is associated with the query logging configuration. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceId(String resourceId); /** *

      * The status of the specified query logging association. Valid values include the following: *

      *
        *
      • *

        * CREATING: Resolver is creating an association between an Amazon VPC and a query logging * configuration. *

        *
      • *
      • *

        * ACTIVE: The association between an Amazon VPC and a query logging configuration was successfully * created. Resolver is logging queries that originate in the specified VPC. *

        *
      • *
      • *

        * DELETING: Resolver is deleting this query logging association. *

        *
      • *
      • *

        * FAILED: Resolver either couldn't create or couldn't delete the query logging association. *

        *
      • *
      * * @param status * The status of the specified query logging association. Valid values include the following:

      *
        *
      • *

        * CREATING: Resolver is creating an association between an Amazon VPC and a query logging * configuration. *

        *
      • *
      • *

        * ACTIVE: The association between an Amazon VPC and a query logging configuration was * successfully created. Resolver is logging queries that originate in the specified VPC. *

        *
      • *
      • *

        * DELETING: Resolver is deleting this query logging association. *

        *
      • *
      • *

        * FAILED: Resolver either couldn't create or couldn't delete the query logging association. *

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

        * The status of the specified query logging association. Valid values include the following: *

        *
          *
        • *

          * CREATING: Resolver is creating an association between an Amazon VPC and a query logging * configuration. *

          *
        • *
        • *

          * ACTIVE: The association between an Amazon VPC and a query logging configuration was successfully * created. Resolver is logging queries that originate in the specified VPC. *

          *
        • *
        • *

          * DELETING: Resolver is deleting this query logging association. *

          *
        • *
        • *

          * FAILED: Resolver either couldn't create or couldn't delete the query logging association. *

          *
        • *
        * * @param status * The status of the specified query logging association. Valid values include the following:

        *
          *
        • *

          * CREATING: Resolver is creating an association between an Amazon VPC and a query logging * configuration. *

          *
        • *
        • *

          * ACTIVE: The association between an Amazon VPC and a query logging configuration was * successfully created. Resolver is logging queries that originate in the specified VPC. *

          *
        • *
        • *

          * DELETING: Resolver is deleting this query logging association. *

          *
        • *
        • *

          * FAILED: Resolver either couldn't create or couldn't delete the query logging association. *

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

          * If the value of Status is FAILED, the value of Error indicates the * cause: *

          *
            *
          • *

            * DESTINATION_NOT_FOUND: The specified destination (for example, an Amazon S3 bucket) was deleted. *

            *
          • *
          • *

            * ACCESS_DENIED: Permissions don't allow sending logs to the destination. *

            *
          • *
          *

          * If the value of Status is a value other than FAILED, Error is null. *

          * * @param error * If the value of Status is FAILED, the value of Error indicates * the cause:

          *
            *
          • *

            * DESTINATION_NOT_FOUND: The specified destination (for example, an Amazon S3 bucket) was * deleted. *

            *
          • *
          • *

            * ACCESS_DENIED: Permissions don't allow sending logs to the destination. *

            *
          • *
          *

          * If the value of Status is a value other than FAILED, Error is * null. * @see ResolverQueryLogConfigAssociationError * @return Returns a reference to this object so that method calls can be chained together. * @see ResolverQueryLogConfigAssociationError */ Builder error(String error); /** *

          * If the value of Status is FAILED, the value of Error indicates the * cause: *

          *
            *
          • *

            * DESTINATION_NOT_FOUND: The specified destination (for example, an Amazon S3 bucket) was deleted. *

            *
          • *
          • *

            * ACCESS_DENIED: Permissions don't allow sending logs to the destination. *

            *
          • *
          *

          * If the value of Status is a value other than FAILED, Error is null. *

          * * @param error * If the value of Status is FAILED, the value of Error indicates * the cause:

          *
            *
          • *

            * DESTINATION_NOT_FOUND: The specified destination (for example, an Amazon S3 bucket) was * deleted. *

            *
          • *
          • *

            * ACCESS_DENIED: Permissions don't allow sending logs to the destination. *

            *
          • *
          *

          * If the value of Status is a value other than FAILED, Error is * null. * @see ResolverQueryLogConfigAssociationError * @return Returns a reference to this object so that method calls can be chained together. * @see ResolverQueryLogConfigAssociationError */ Builder error(ResolverQueryLogConfigAssociationError error); /** *

          * Contains additional information about the error. If the value or Error is null, the value of * ErrorMessage also is null. *

          * * @param errorMessage * Contains additional information about the error. If the value or Error is null, the value * of ErrorMessage also is null. * @return Returns a reference to this object so that method calls can be chained together. */ Builder errorMessage(String errorMessage); /** *

          * The date and time that the VPC was associated with the query logging configuration, in Unix time format and * Coordinated Universal Time (UTC). *

          * * @param creationTime * The date and time that the VPC was associated with the query logging configuration, in Unix time * format and Coordinated Universal Time (UTC). * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(String creationTime); } static final class BuilderImpl implements Builder { private String id; private String resolverQueryLogConfigId; private String resourceId; private String status; private String error; private String errorMessage; private String creationTime; private BuilderImpl() { } private BuilderImpl(ResolverQueryLogConfigAssociation model) { id(model.id); resolverQueryLogConfigId(model.resolverQueryLogConfigId); resourceId(model.resourceId); status(model.status); error(model.error); errorMessage(model.errorMessage); creationTime(model.creationTime); } public final String getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final String getResolverQueryLogConfigId() { return resolverQueryLogConfigId; } public final void setResolverQueryLogConfigId(String resolverQueryLogConfigId) { this.resolverQueryLogConfigId = resolverQueryLogConfigId; } @Override public final Builder resolverQueryLogConfigId(String resolverQueryLogConfigId) { this.resolverQueryLogConfigId = resolverQueryLogConfigId; return this; } public final String getResourceId() { return resourceId; } public final void setResourceId(String resourceId) { this.resourceId = resourceId; } @Override public final Builder resourceId(String resourceId) { this.resourceId = resourceId; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(ResolverQueryLogConfigAssociationStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getError() { return error; } public final void setError(String error) { this.error = error; } @Override public final Builder error(String error) { this.error = error; return this; } @Override public final Builder error(ResolverQueryLogConfigAssociationError error) { this.error(error == null ? null : error.toString()); return this; } public final String getErrorMessage() { return errorMessage; } public final void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } @Override public final Builder errorMessage(String errorMessage) { this.errorMessage = errorMessage; return this; } public final String getCreationTime() { return creationTime; } public final void setCreationTime(String creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(String creationTime) { this.creationTime = creationTime; return this; } @Override public ResolverQueryLogConfigAssociation build() { return new ResolverQueryLogConfigAssociation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy