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

software.amazon.awssdk.services.glue.model.CrawlerHistory 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.glue.model;

import java.io.Serializable;
import java.time.Instant;
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.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;

/**
 * 

* Contains the information for a run of a crawler. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CrawlerHistory implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CRAWL_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CrawlId").getter(getter(CrawlerHistory::crawlId)).setter(setter(Builder::crawlId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CrawlId").build()).build(); private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("State") .getter(getter(CrawlerHistory::stateAsString)).setter(setter(Builder::state)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State").build()).build(); private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("StartTime").getter(getter(CrawlerHistory::startTime)).setter(setter(Builder::startTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build(); private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("EndTime").getter(getter(CrawlerHistory::endTime)).setter(setter(Builder::endTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndTime").build()).build(); private static final SdkField SUMMARY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Summary") .getter(getter(CrawlerHistory::summary)).setter(setter(Builder::summary)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Summary").build()).build(); private static final SdkField ERROR_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ErrorMessage").getter(getter(CrawlerHistory::errorMessage)).setter(setter(Builder::errorMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ErrorMessage").build()).build(); private static final SdkField LOG_GROUP_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LogGroup").getter(getter(CrawlerHistory::logGroup)).setter(setter(Builder::logGroup)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LogGroup").build()).build(); private static final SdkField LOG_STREAM_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LogStream").getter(getter(CrawlerHistory::logStream)).setter(setter(Builder::logStream)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LogStream").build()).build(); private static final SdkField MESSAGE_PREFIX_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MessagePrefix").getter(getter(CrawlerHistory::messagePrefix)).setter(setter(Builder::messagePrefix)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MessagePrefix").build()).build(); private static final SdkField DPU_HOUR_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("DPUHour").getter(getter(CrawlerHistory::dpuHour)).setter(setter(Builder::dpuHour)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DPUHour").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CRAWL_ID_FIELD, STATE_FIELD, START_TIME_FIELD, END_TIME_FIELD, SUMMARY_FIELD, ERROR_MESSAGE_FIELD, LOG_GROUP_FIELD, LOG_STREAM_FIELD, MESSAGE_PREFIX_FIELD, DPU_HOUR_FIELD)); private static final long serialVersionUID = 1L; private final String crawlId; private final String state; private final Instant startTime; private final Instant endTime; private final String summary; private final String errorMessage; private final String logGroup; private final String logStream; private final String messagePrefix; private final Double dpuHour; private CrawlerHistory(BuilderImpl builder) { this.crawlId = builder.crawlId; this.state = builder.state; this.startTime = builder.startTime; this.endTime = builder.endTime; this.summary = builder.summary; this.errorMessage = builder.errorMessage; this.logGroup = builder.logGroup; this.logStream = builder.logStream; this.messagePrefix = builder.messagePrefix; this.dpuHour = builder.dpuHour; } /** *

* A UUID identifier for each crawl. *

* * @return A UUID identifier for each crawl. */ public final String crawlId() { return crawlId; } /** *

* The state of the crawl. *

*

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

* * @return The state of the crawl. * @see CrawlerHistoryState */ public final CrawlerHistoryState state() { return CrawlerHistoryState.fromValue(state); } /** *

* The state of the crawl. *

*

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

* * @return The state of the crawl. * @see CrawlerHistoryState */ public final String stateAsString() { return state; } /** *

* The date and time on which the crawl started. *

* * @return The date and time on which the crawl started. */ public final Instant startTime() { return startTime; } /** *

* The date and time on which the crawl ended. *

* * @return The date and time on which the crawl ended. */ public final Instant endTime() { return endTime; } /** *

* A run summary for the specific crawl in JSON. Contains the catalog tables and partitions that were added, * updated, or deleted. *

* * @return A run summary for the specific crawl in JSON. Contains the catalog tables and partitions that were added, * updated, or deleted. */ public final String summary() { return summary; } /** *

* If an error occurred, the error message associated with the crawl. *

* * @return If an error occurred, the error message associated with the crawl. */ public final String errorMessage() { return errorMessage; } /** *

* The log group associated with the crawl. *

* * @return The log group associated with the crawl. */ public final String logGroup() { return logGroup; } /** *

* The log stream associated with the crawl. *

* * @return The log stream associated with the crawl. */ public final String logStream() { return logStream; } /** *

* The prefix for a CloudWatch message about this crawl. *

* * @return The prefix for a CloudWatch message about this crawl. */ public final String messagePrefix() { return messagePrefix; } /** *

* The number of data processing units (DPU) used in hours for the crawl. *

* * @return The number of data processing units (DPU) used in hours for the crawl. */ public final Double dpuHour() { return dpuHour; } @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(crawlId()); hashCode = 31 * hashCode + Objects.hashCode(stateAsString()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(endTime()); hashCode = 31 * hashCode + Objects.hashCode(summary()); hashCode = 31 * hashCode + Objects.hashCode(errorMessage()); hashCode = 31 * hashCode + Objects.hashCode(logGroup()); hashCode = 31 * hashCode + Objects.hashCode(logStream()); hashCode = 31 * hashCode + Objects.hashCode(messagePrefix()); hashCode = 31 * hashCode + Objects.hashCode(dpuHour()); 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 CrawlerHistory)) { return false; } CrawlerHistory other = (CrawlerHistory) obj; return Objects.equals(crawlId(), other.crawlId()) && Objects.equals(stateAsString(), other.stateAsString()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(endTime(), other.endTime()) && Objects.equals(summary(), other.summary()) && Objects.equals(errorMessage(), other.errorMessage()) && Objects.equals(logGroup(), other.logGroup()) && Objects.equals(logStream(), other.logStream()) && Objects.equals(messagePrefix(), other.messagePrefix()) && Objects.equals(dpuHour(), other.dpuHour()); } /** * 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("CrawlerHistory").add("CrawlId", crawlId()).add("State", stateAsString()) .add("StartTime", startTime()).add("EndTime", endTime()).add("Summary", summary()) .add("ErrorMessage", errorMessage()).add("LogGroup", logGroup()).add("LogStream", logStream()) .add("MessagePrefix", messagePrefix()).add("DPUHour", dpuHour()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "CrawlId": return Optional.ofNullable(clazz.cast(crawlId())); case "State": return Optional.ofNullable(clazz.cast(stateAsString())); case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "EndTime": return Optional.ofNullable(clazz.cast(endTime())); case "Summary": return Optional.ofNullable(clazz.cast(summary())); case "ErrorMessage": return Optional.ofNullable(clazz.cast(errorMessage())); case "LogGroup": return Optional.ofNullable(clazz.cast(logGroup())); case "LogStream": return Optional.ofNullable(clazz.cast(logStream())); case "MessagePrefix": return Optional.ofNullable(clazz.cast(messagePrefix())); case "DPUHour": return Optional.ofNullable(clazz.cast(dpuHour())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CrawlerHistory) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* A UUID identifier for each crawl. *

* * @param crawlId * A UUID identifier for each crawl. * @return Returns a reference to this object so that method calls can be chained together. */ Builder crawlId(String crawlId); /** *

* The state of the crawl. *

* * @param state * The state of the crawl. * @see CrawlerHistoryState * @return Returns a reference to this object so that method calls can be chained together. * @see CrawlerHistoryState */ Builder state(String state); /** *

* The state of the crawl. *

* * @param state * The state of the crawl. * @see CrawlerHistoryState * @return Returns a reference to this object so that method calls can be chained together. * @see CrawlerHistoryState */ Builder state(CrawlerHistoryState state); /** *

* The date and time on which the crawl started. *

* * @param startTime * The date and time on which the crawl started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* The date and time on which the crawl ended. *

* * @param endTime * The date and time on which the crawl ended. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endTime(Instant endTime); /** *

* A run summary for the specific crawl in JSON. Contains the catalog tables and partitions that were added, * updated, or deleted. *

* * @param summary * A run summary for the specific crawl in JSON. Contains the catalog tables and partitions that were * added, updated, or deleted. * @return Returns a reference to this object so that method calls can be chained together. */ Builder summary(String summary); /** *

* If an error occurred, the error message associated with the crawl. *

* * @param errorMessage * If an error occurred, the error message associated with the crawl. * @return Returns a reference to this object so that method calls can be chained together. */ Builder errorMessage(String errorMessage); /** *

* The log group associated with the crawl. *

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

* The log stream associated with the crawl. *

* * @param logStream * The log stream associated with the crawl. * @return Returns a reference to this object so that method calls can be chained together. */ Builder logStream(String logStream); /** *

* The prefix for a CloudWatch message about this crawl. *

* * @param messagePrefix * The prefix for a CloudWatch message about this crawl. * @return Returns a reference to this object so that method calls can be chained together. */ Builder messagePrefix(String messagePrefix); /** *

* The number of data processing units (DPU) used in hours for the crawl. *

* * @param dpuHour * The number of data processing units (DPU) used in hours for the crawl. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dpuHour(Double dpuHour); } static final class BuilderImpl implements Builder { private String crawlId; private String state; private Instant startTime; private Instant endTime; private String summary; private String errorMessage; private String logGroup; private String logStream; private String messagePrefix; private Double dpuHour; private BuilderImpl() { } private BuilderImpl(CrawlerHistory model) { crawlId(model.crawlId); state(model.state); startTime(model.startTime); endTime(model.endTime); summary(model.summary); errorMessage(model.errorMessage); logGroup(model.logGroup); logStream(model.logStream); messagePrefix(model.messagePrefix); dpuHour(model.dpuHour); } public final String getCrawlId() { return crawlId; } public final void setCrawlId(String crawlId) { this.crawlId = crawlId; } @Override public final Builder crawlId(String crawlId) { this.crawlId = crawlId; return this; } public final String getState() { return state; } public final void setState(String state) { this.state = state; } @Override public final Builder state(String state) { this.state = state; return this; } @Override public final Builder state(CrawlerHistoryState state) { this.state(state == null ? null : state.toString()); return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final Instant getEndTime() { return endTime; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override public final Builder endTime(Instant endTime) { this.endTime = endTime; return this; } public final String getSummary() { return summary; } public final void setSummary(String summary) { this.summary = summary; } @Override public final Builder summary(String summary) { this.summary = summary; 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 getLogGroup() { return logGroup; } public final void setLogGroup(String logGroup) { this.logGroup = logGroup; } @Override public final Builder logGroup(String logGroup) { this.logGroup = logGroup; return this; } public final String getLogStream() { return logStream; } public final void setLogStream(String logStream) { this.logStream = logStream; } @Override public final Builder logStream(String logStream) { this.logStream = logStream; return this; } public final String getMessagePrefix() { return messagePrefix; } public final void setMessagePrefix(String messagePrefix) { this.messagePrefix = messagePrefix; } @Override public final Builder messagePrefix(String messagePrefix) { this.messagePrefix = messagePrefix; return this; } public final Double getDpuHour() { return dpuHour; } public final void setDpuHour(Double dpuHour) { this.dpuHour = dpuHour; } @Override public final Builder dpuHour(Double dpuHour) { this.dpuHour = dpuHour; return this; } @Override public CrawlerHistory build() { return new CrawlerHistory(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy