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

software.amazon.awssdk.services.rds.model.DownloadDbLogFilePortionRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon RDS module holds the client classes that are used for communicating with Amazon Relational Database Service

There is a newer version: 2.30.1
Show newest version
/*
 * 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.rds.model;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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;

/**
 * 

*/ @Generated("software.amazon.awssdk:codegen") public final class DownloadDbLogFilePortionRequest extends RdsRequest implements ToCopyableBuilder { private static final SdkField DB_INSTANCE_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(DownloadDbLogFilePortionRequest::dbInstanceIdentifier)).setter(setter(Builder::dbInstanceIdentifier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBInstanceIdentifier").build()) .build(); private static final SdkField LOG_FILE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(DownloadDbLogFilePortionRequest::logFileName)).setter(setter(Builder::logFileName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LogFileName").build()).build(); private static final SdkField MARKER_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(DownloadDbLogFilePortionRequest::marker)).setter(setter(Builder::marker)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Marker").build()).build(); private static final SdkField NUMBER_OF_LINES_FIELD = SdkField. builder(MarshallingType.INTEGER) .getter(getter(DownloadDbLogFilePortionRequest::numberOfLines)).setter(setter(Builder::numberOfLines)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NumberOfLines").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DB_INSTANCE_IDENTIFIER_FIELD, LOG_FILE_NAME_FIELD, MARKER_FIELD, NUMBER_OF_LINES_FIELD)); private final String dbInstanceIdentifier; private final String logFileName; private final String marker; private final Integer numberOfLines; private DownloadDbLogFilePortionRequest(BuilderImpl builder) { super(builder); this.dbInstanceIdentifier = builder.dbInstanceIdentifier; this.logFileName = builder.logFileName; this.marker = builder.marker; this.numberOfLines = builder.numberOfLines; } /** *

* The customer-assigned name of the DB instance that contains the log files you want to list. *

*

* Constraints: *

*
    *
  • *

    * Must match the identifier of an existing DBInstance. *

    *
  • *
* * @return The customer-assigned name of the DB instance that contains the log files you want to list.

*

* Constraints: *

*
    *
  • *

    * Must match the identifier of an existing DBInstance. *

    *
  • */ public String dbInstanceIdentifier() { return dbInstanceIdentifier; } /** *

    * The name of the log file to be downloaded. *

    * * @return The name of the log file to be downloaded. */ public String logFileName() { return logFileName; } /** *

    * The pagination token provided in the previous request or "0". If the Marker parameter is specified the response * includes only records beyond the marker until the end of the file or up to NumberOfLines. *

    * * @return The pagination token provided in the previous request or "0". If the Marker parameter is specified the * response includes only records beyond the marker until the end of the file or up to NumberOfLines. */ public String marker() { return marker; } /** *

    * The number of lines to download. If the number of lines specified results in a file over 1 MB in size, the file * is truncated at 1 MB in size. *

    *

    * If the NumberOfLines parameter is specified, then the block of lines returned can be from the beginning or the * end of the log file, depending on the value of the Marker parameter. *

    *
      *
    • *

      * If neither Marker or NumberOfLines are specified, the entire log file is returned up to a maximum of 10000 lines, * starting with the most recent log entries first. *

      *
    • *
    • *

      * If NumberOfLines is specified and Marker isn't specified, then the most recent lines from the end of the log file * are returned. *

      *
    • *
    • *

      * If Marker is specified as "0", then the specified number of lines from the beginning of the log file are * returned. *

      *
    • *
    • *

      * You can download the log file in blocks of lines by specifying the size of the block using the NumberOfLines * parameter, and by specifying a value of "0" for the Marker parameter in your first request. Include the Marker * value returned in the response as the Marker value for the next request, continuing until the * AdditionalDataPending response element returns false. *

      *
    • *
    * * @return The number of lines to download. If the number of lines specified results in a file over 1 MB in size, * the file is truncated at 1 MB in size.

    *

    * If the NumberOfLines parameter is specified, then the block of lines returned can be from the beginning * or the end of the log file, depending on the value of the Marker parameter. *

    *
      *
    • *

      * If neither Marker or NumberOfLines are specified, the entire log file is returned up to a maximum of * 10000 lines, starting with the most recent log entries first. *

      *
    • *
    • *

      * If NumberOfLines is specified and Marker isn't specified, then the most recent lines from the end of the * log file are returned. *

      *
    • *
    • *

      * If Marker is specified as "0", then the specified number of lines from the beginning of the log file are * returned. *

      *
    • *
    • *

      * You can download the log file in blocks of lines by specifying the size of the block using the * NumberOfLines parameter, and by specifying a value of "0" for the Marker parameter in your first request. * Include the Marker value returned in the response as the Marker value for the next request, continuing * until the AdditionalDataPending response element returns false. *

      *
    • */ public Integer numberOfLines() { return numberOfLines; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(dbInstanceIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(logFileName()); hashCode = 31 * hashCode + Objects.hashCode(marker()); hashCode = 31 * hashCode + Objects.hashCode(numberOfLines()); return hashCode; } @Override public boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DownloadDbLogFilePortionRequest)) { return false; } DownloadDbLogFilePortionRequest other = (DownloadDbLogFilePortionRequest) obj; return Objects.equals(dbInstanceIdentifier(), other.dbInstanceIdentifier()) && Objects.equals(logFileName(), other.logFileName()) && Objects.equals(marker(), other.marker()) && Objects.equals(numberOfLines(), other.numberOfLines()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public String toString() { return ToString.builder("DownloadDbLogFilePortionRequest").add("DBInstanceIdentifier", dbInstanceIdentifier()) .add("LogFileName", logFileName()).add("Marker", marker()).add("NumberOfLines", numberOfLines()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DBInstanceIdentifier": return Optional.ofNullable(clazz.cast(dbInstanceIdentifier())); case "LogFileName": return Optional.ofNullable(clazz.cast(logFileName())); case "Marker": return Optional.ofNullable(clazz.cast(marker())); case "NumberOfLines": return Optional.ofNullable(clazz.cast(numberOfLines())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DownloadDbLogFilePortionRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends RdsRequest.Builder, SdkPojo, CopyableBuilder { /** *

      * The customer-assigned name of the DB instance that contains the log files you want to list. *

      *

      * Constraints: *

      *
        *
      • *

        * Must match the identifier of an existing DBInstance. *

        *
      • *
      * * @param dbInstanceIdentifier * The customer-assigned name of the DB instance that contains the log files you want to list.

      *

      * Constraints: *

      *
        *
      • *

        * Must match the identifier of an existing DBInstance. *

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

        * The name of the log file to be downloaded. *

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

        * The pagination token provided in the previous request or "0". If the Marker parameter is specified the * response includes only records beyond the marker until the end of the file or up to NumberOfLines. *

        * * @param marker * The pagination token provided in the previous request or "0". If the Marker parameter is specified the * response includes only records beyond the marker until the end of the file or up to NumberOfLines. * @return Returns a reference to this object so that method calls can be chained together. */ Builder marker(String marker); /** *

        * The number of lines to download. If the number of lines specified results in a file over 1 MB in size, the * file is truncated at 1 MB in size. *

        *

        * If the NumberOfLines parameter is specified, then the block of lines returned can be from the beginning or * the end of the log file, depending on the value of the Marker parameter. *

        *
          *
        • *

          * If neither Marker or NumberOfLines are specified, the entire log file is returned up to a maximum of 10000 * lines, starting with the most recent log entries first. *

          *
        • *
        • *

          * If NumberOfLines is specified and Marker isn't specified, then the most recent lines from the end of the log * file are returned. *

          *
        • *
        • *

          * If Marker is specified as "0", then the specified number of lines from the beginning of the log file are * returned. *

          *
        • *
        • *

          * You can download the log file in blocks of lines by specifying the size of the block using the NumberOfLines * parameter, and by specifying a value of "0" for the Marker parameter in your first request. Include the * Marker value returned in the response as the Marker value for the next request, continuing until the * AdditionalDataPending response element returns false. *

          *
        • *
        * * @param numberOfLines * The number of lines to download. If the number of lines specified results in a file over 1 MB in size, * the file is truncated at 1 MB in size.

        *

        * If the NumberOfLines parameter is specified, then the block of lines returned can be from the * beginning or the end of the log file, depending on the value of the Marker parameter. *

        *
          *
        • *

          * If neither Marker or NumberOfLines are specified, the entire log file is returned up to a maximum of * 10000 lines, starting with the most recent log entries first. *

          *
        • *
        • *

          * If NumberOfLines is specified and Marker isn't specified, then the most recent lines from the end of * the log file are returned. *

          *
        • *
        • *

          * If Marker is specified as "0", then the specified number of lines from the beginning of the log file * are returned. *

          *
        • *
        • *

          * You can download the log file in blocks of lines by specifying the size of the block using the * NumberOfLines parameter, and by specifying a value of "0" for the Marker parameter in your first * request. Include the Marker value returned in the response as the Marker value for the next request, * continuing until the AdditionalDataPending response element returns false. *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. */ Builder numberOfLines(Integer numberOfLines); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends RdsRequest.BuilderImpl implements Builder { private String dbInstanceIdentifier; private String logFileName; private String marker; private Integer numberOfLines; private BuilderImpl() { } private BuilderImpl(DownloadDbLogFilePortionRequest model) { super(model); dbInstanceIdentifier(model.dbInstanceIdentifier); logFileName(model.logFileName); marker(model.marker); numberOfLines(model.numberOfLines); } public final String getDbInstanceIdentifier() { return dbInstanceIdentifier; } @Override public final Builder dbInstanceIdentifier(String dbInstanceIdentifier) { this.dbInstanceIdentifier = dbInstanceIdentifier; return this; } public final void setDbInstanceIdentifier(String dbInstanceIdentifier) { this.dbInstanceIdentifier = dbInstanceIdentifier; } public final String getLogFileName() { return logFileName; } @Override public final Builder logFileName(String logFileName) { this.logFileName = logFileName; return this; } public final void setLogFileName(String logFileName) { this.logFileName = logFileName; } public final String getMarker() { return marker; } @Override public final Builder marker(String marker) { this.marker = marker; return this; } public final void setMarker(String marker) { this.marker = marker; } public final Integer getNumberOfLines() { return numberOfLines; } @Override public final Builder numberOfLines(Integer numberOfLines) { this.numberOfLines = numberOfLines; return this; } public final void setNumberOfLines(Integer numberOfLines) { this.numberOfLines = numberOfLines; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public DownloadDbLogFilePortionRequest build() { return new DownloadDbLogFilePortionRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy