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

software.amazon.awssdk.services.databrew.model.Schedule Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Data Brew module holds the client classes that are used for communicating with Data Brew.

There is a newer version: 2.29.15
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.databrew.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
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.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Represents one or more dates and times when a job is to run. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Schedule implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AccountId").getter(getter(Schedule::accountId)).setter(setter(Builder::accountId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccountId").build()).build(); private static final SdkField CREATED_BY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CreatedBy").getter(getter(Schedule::createdBy)).setter(setter(Builder::createdBy)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedBy").build()).build(); private static final SdkField CREATE_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("CreateDate").getter(getter(Schedule::createDate)).setter(setter(Builder::createDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreateDate").build()).build(); private static final SdkField> JOB_NAMES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("JobNames") .getter(getter(Schedule::jobNames)) .setter(setter(Builder::jobNames)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobNames").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 LAST_MODIFIED_BY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LastModifiedBy").getter(getter(Schedule::lastModifiedBy)).setter(setter(Builder::lastModifiedBy)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedBy").build()).build(); private static final SdkField LAST_MODIFIED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("LastModifiedDate").getter(getter(Schedule::lastModifiedDate)).setter(setter(Builder::lastModifiedDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedDate").build()).build(); private static final SdkField RESOURCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ResourceArn").getter(getter(Schedule::resourceArn)).setter(setter(Builder::resourceArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceArn").build()).build(); private static final SdkField CRON_EXPRESSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CronExpression").getter(getter(Schedule::cronExpression)).setter(setter(Builder::cronExpression)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CronExpression").build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("Tags") .getter(getter(Schedule::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(Schedule::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCOUNT_ID_FIELD, CREATED_BY_FIELD, CREATE_DATE_FIELD, JOB_NAMES_FIELD, LAST_MODIFIED_BY_FIELD, LAST_MODIFIED_DATE_FIELD, RESOURCE_ARN_FIELD, CRON_EXPRESSION_FIELD, TAGS_FIELD, NAME_FIELD)); private static final long serialVersionUID = 1L; private final String accountId; private final String createdBy; private final Instant createDate; private final List jobNames; private final String lastModifiedBy; private final Instant lastModifiedDate; private final String resourceArn; private final String cronExpression; private final Map tags; private final String name; private Schedule(BuilderImpl builder) { this.accountId = builder.accountId; this.createdBy = builder.createdBy; this.createDate = builder.createDate; this.jobNames = builder.jobNames; this.lastModifiedBy = builder.lastModifiedBy; this.lastModifiedDate = builder.lastModifiedDate; this.resourceArn = builder.resourceArn; this.cronExpression = builder.cronExpression; this.tags = builder.tags; this.name = builder.name; } /** *

* The ID of the Amazon Web Services account that owns the schedule. *

* * @return The ID of the Amazon Web Services account that owns the schedule. */ public final String accountId() { return accountId; } /** *

* The Amazon Resource Name (ARN) of the user who created the schedule. *

* * @return The Amazon Resource Name (ARN) of the user who created the schedule. */ public final String createdBy() { return createdBy; } /** *

* The date and time that the schedule was created. *

* * @return The date and time that the schedule was created. */ public final Instant createDate() { return createDate; } /** * For responses, this returns true if the service returned a value for the JobNames 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 hasJobNames() { return jobNames != null && !(jobNames instanceof SdkAutoConstructList); } /** *

* A list of jobs to be run, according to the schedule. *

*

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

* * @return A list of jobs to be run, according to the schedule. */ public final List jobNames() { return jobNames; } /** *

* The Amazon Resource Name (ARN) of the user who last modified the schedule. *

* * @return The Amazon Resource Name (ARN) of the user who last modified the schedule. */ public final String lastModifiedBy() { return lastModifiedBy; } /** *

* The date and time when the schedule was last modified. *

* * @return The date and time when the schedule was last modified. */ public final Instant lastModifiedDate() { return lastModifiedDate; } /** *

* The Amazon Resource Name (ARN) of the schedule. *

* * @return The Amazon Resource Name (ARN) of the schedule. */ public final String resourceArn() { return resourceArn; } /** *

* The dates and times when the job is to run. For more information, see Cron expressions in the Glue DataBrew * Developer Guide. *

* * @return The dates and times when the job is to run. For more information, see Cron expressions in the Glue * DataBrew Developer Guide. */ public final String cronExpression() { return cronExpression; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check 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 hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** *

* Metadata tags that have been applied to the schedule. *

*

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

* * @return Metadata tags that have been applied to the schedule. */ public final Map tags() { return tags; } /** *

* The name of the schedule. *

* * @return The name of the schedule. */ public final String name() { return name; } @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(accountId()); hashCode = 31 * hashCode + Objects.hashCode(createdBy()); hashCode = 31 * hashCode + Objects.hashCode(createDate()); hashCode = 31 * hashCode + Objects.hashCode(hasJobNames() ? jobNames() : null); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedBy()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedDate()); hashCode = 31 * hashCode + Objects.hashCode(resourceArn()); hashCode = 31 * hashCode + Objects.hashCode(cronExpression()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(name()); 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 Schedule)) { return false; } Schedule other = (Schedule) obj; return Objects.equals(accountId(), other.accountId()) && Objects.equals(createdBy(), other.createdBy()) && Objects.equals(createDate(), other.createDate()) && hasJobNames() == other.hasJobNames() && Objects.equals(jobNames(), other.jobNames()) && Objects.equals(lastModifiedBy(), other.lastModifiedBy()) && Objects.equals(lastModifiedDate(), other.lastModifiedDate()) && Objects.equals(resourceArn(), other.resourceArn()) && Objects.equals(cronExpression(), other.cronExpression()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(name(), other.name()); } /** * 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("Schedule").add("AccountId", accountId()).add("CreatedBy", createdBy()) .add("CreateDate", createDate()).add("JobNames", hasJobNames() ? jobNames() : null) .add("LastModifiedBy", lastModifiedBy()).add("LastModifiedDate", lastModifiedDate()) .add("ResourceArn", resourceArn()).add("CronExpression", cronExpression()).add("Tags", hasTags() ? tags() : null) .add("Name", name()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AccountId": return Optional.ofNullable(clazz.cast(accountId())); case "CreatedBy": return Optional.ofNullable(clazz.cast(createdBy())); case "CreateDate": return Optional.ofNullable(clazz.cast(createDate())); case "JobNames": return Optional.ofNullable(clazz.cast(jobNames())); case "LastModifiedBy": return Optional.ofNullable(clazz.cast(lastModifiedBy())); case "LastModifiedDate": return Optional.ofNullable(clazz.cast(lastModifiedDate())); case "ResourceArn": return Optional.ofNullable(clazz.cast(resourceArn())); case "CronExpression": return Optional.ofNullable(clazz.cast(cronExpression())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "Name": return Optional.ofNullable(clazz.cast(name())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Schedule) 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 Amazon Web Services account that owns the schedule. *

* * @param accountId * The ID of the Amazon Web Services account that owns the schedule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder accountId(String accountId); /** *

* The Amazon Resource Name (ARN) of the user who created the schedule. *

* * @param createdBy * The Amazon Resource Name (ARN) of the user who created the schedule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdBy(String createdBy); /** *

* The date and time that the schedule was created. *

* * @param createDate * The date and time that the schedule was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createDate(Instant createDate); /** *

* A list of jobs to be run, according to the schedule. *

* * @param jobNames * A list of jobs to be run, according to the schedule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobNames(Collection jobNames); /** *

* A list of jobs to be run, according to the schedule. *

* * @param jobNames * A list of jobs to be run, according to the schedule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobNames(String... jobNames); /** *

* The Amazon Resource Name (ARN) of the user who last modified the schedule. *

* * @param lastModifiedBy * The Amazon Resource Name (ARN) of the user who last modified the schedule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedBy(String lastModifiedBy); /** *

* The date and time when the schedule was last modified. *

* * @param lastModifiedDate * The date and time when the schedule was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedDate(Instant lastModifiedDate); /** *

* The Amazon Resource Name (ARN) of the schedule. *

* * @param resourceArn * The Amazon Resource Name (ARN) of the schedule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceArn(String resourceArn); /** *

* The dates and times when the job is to run. For more information, see Cron expressions in the Glue * DataBrew Developer Guide. *

* * @param cronExpression * The dates and times when the job is to run. For more information, see Cron expressions in the * Glue DataBrew Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cronExpression(String cronExpression); /** *

* Metadata tags that have been applied to the schedule. *

* * @param tags * Metadata tags that have been applied to the schedule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); /** *

* The name of the schedule. *

* * @param name * The name of the schedule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); } static final class BuilderImpl implements Builder { private String accountId; private String createdBy; private Instant createDate; private List jobNames = DefaultSdkAutoConstructList.getInstance(); private String lastModifiedBy; private Instant lastModifiedDate; private String resourceArn; private String cronExpression; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private String name; private BuilderImpl() { } private BuilderImpl(Schedule model) { accountId(model.accountId); createdBy(model.createdBy); createDate(model.createDate); jobNames(model.jobNames); lastModifiedBy(model.lastModifiedBy); lastModifiedDate(model.lastModifiedDate); resourceArn(model.resourceArn); cronExpression(model.cronExpression); tags(model.tags); name(model.name); } public final String getAccountId() { return accountId; } public final void setAccountId(String accountId) { this.accountId = accountId; } @Override public final Builder accountId(String accountId) { this.accountId = accountId; return this; } public final String getCreatedBy() { return createdBy; } public final void setCreatedBy(String createdBy) { this.createdBy = createdBy; } @Override public final Builder createdBy(String createdBy) { this.createdBy = createdBy; return this; } public final Instant getCreateDate() { return createDate; } public final void setCreateDate(Instant createDate) { this.createDate = createDate; } @Override public final Builder createDate(Instant createDate) { this.createDate = createDate; return this; } public final Collection getJobNames() { if (jobNames instanceof SdkAutoConstructList) { return null; } return jobNames; } public final void setJobNames(Collection jobNames) { this.jobNames = JobNameListCopier.copy(jobNames); } @Override public final Builder jobNames(Collection jobNames) { this.jobNames = JobNameListCopier.copy(jobNames); return this; } @Override @SafeVarargs public final Builder jobNames(String... jobNames) { jobNames(Arrays.asList(jobNames)); return this; } public final String getLastModifiedBy() { return lastModifiedBy; } public final void setLastModifiedBy(String lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; } @Override public final Builder lastModifiedBy(String lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; return this; } public final Instant getLastModifiedDate() { return lastModifiedDate; } public final void setLastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } @Override public final Builder lastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; return this; } public final String getResourceArn() { return resourceArn; } public final void setResourceArn(String resourceArn) { this.resourceArn = resourceArn; } @Override public final Builder resourceArn(String resourceArn) { this.resourceArn = resourceArn; return this; } public final String getCronExpression() { return cronExpression; } public final void setCronExpression(String cronExpression) { this.cronExpression = cronExpression; } @Override public final Builder cronExpression(String cronExpression) { this.cronExpression = cronExpression; return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = TagMapCopier.copy(tags); } @Override public final Builder tags(Map tags) { this.tags = TagMapCopier.copy(tags); return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } @Override public Schedule build() { return new Schedule(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy