/* * Copyright 2018-2023 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 com.amazonaws.services.glue.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Defines an action to be initiated by a trigger. *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Action implements Serializable, Cloneable, StructuredPojo { /** *

* The name of a job to be run. *

*/ private String jobName; /** *

* The job arguments used when this trigger fires. For this job run, they replace the default arguments set in the * job definition itself. *

*

* You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue itself * consumes. *

*

* For information about how to specify and consume your own Job arguments, see the Calling Glue APIs in * Python topic in the developer guide. *

*

* For information about the key-value pairs that Glue consumes to set up your job, see the Special Parameters * Used by Glue topic in the developer guide. *

*/ private java.util.Map arguments; /** *

* The JobRun timeout in minutes. This is the maximum time that a job run can consume resources before * it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours). This overrides * the timeout value set in the parent job. *

*/ private Integer timeout; /** *

* The name of the SecurityConfiguration structure to be used with this action. *

*/ private String securityConfiguration; /** *

* Specifies configuration properties of a job run notification. *

*/ private NotificationProperty notificationProperty; /** *

* The name of the crawler to be used with this action. *

*/ private String crawlerName; /** *

* The name of a job to be run. *

* * @param jobName * The name of a job to be run. */ public void setJobName(String jobName) { this.jobName = jobName; } /** *

* The name of a job to be run. *

* * @return The name of a job to be run. */ public String getJobName() { return this.jobName; } /** *

* The name of a job to be run. *

* * @param jobName * The name of a job to be run. * @return Returns a reference to this object so that method calls can be chained together. */ public Action withJobName(String jobName) { setJobName(jobName); return this; } /** *

* The job arguments used when this trigger fires. For this job run, they replace the default arguments set in the * job definition itself. *

*

* You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue itself * consumes. *

*

* For information about how to specify and consume your own Job arguments, see the Calling Glue APIs in * Python topic in the developer guide. *

*

* For information about the key-value pairs that Glue consumes to set up your job, see the Special Parameters * Used by Glue topic in the developer guide. *

* * @return The job arguments used when this trigger fires. For this job run, they replace the default arguments set * in the job definition itself.

*

* You can specify arguments here that your own job-execution script consumes, as well as arguments that * Glue itself consumes. *

*

* For information about how to specify and consume your own Job arguments, see the Calling Glue * APIs in Python topic in the developer guide. *

*

* For information about the key-value pairs that Glue consumes to set up your job, see the Special * Parameters Used by Glue topic in the developer guide. */ public java.util.Map getArguments() { return arguments; } /** *

* The job arguments used when this trigger fires. For this job run, they replace the default arguments set in the * job definition itself. *

*

* You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue itself * consumes. *

*

* For information about how to specify and consume your own Job arguments, see the Calling Glue APIs in * Python topic in the developer guide. *

*

* For information about the key-value pairs that Glue consumes to set up your job, see the Special Parameters * Used by Glue topic in the developer guide. *

* * @param arguments * The job arguments used when this trigger fires. For this job run, they replace the default arguments set * in the job definition itself.

*

* You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue * itself consumes. *

*

* For information about how to specify and consume your own Job arguments, see the Calling Glue * APIs in Python topic in the developer guide. *

*

* For information about the key-value pairs that Glue consumes to set up your job, see the Special * Parameters Used by Glue topic in the developer guide. */ public void setArguments(java.util.Map arguments) { this.arguments = arguments; } /** *

* The job arguments used when this trigger fires. For this job run, they replace the default arguments set in the * job definition itself. *

*

* You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue itself * consumes. *

*

* For information about how to specify and consume your own Job arguments, see the Calling Glue APIs in * Python topic in the developer guide. *

*

* For information about the key-value pairs that Glue consumes to set up your job, see the Special Parameters * Used by Glue topic in the developer guide. *

* * @param arguments * The job arguments used when this trigger fires. For this job run, they replace the default arguments set * in the job definition itself.

*

* You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue * itself consumes. *

*

* For information about how to specify and consume your own Job arguments, see the Calling Glue * APIs in Python topic in the developer guide. *

*

* For information about the key-value pairs that Glue consumes to set up your job, see the Special * Parameters Used by Glue topic in the developer guide. * @return Returns a reference to this object so that method calls can be chained together. */ public Action withArguments(java.util.Map arguments) { setArguments(arguments); return this; } /** * Add a single Arguments entry * * @see Action#withArguments * @returns a reference to this object so that method calls can be chained together. */ public Action addArgumentsEntry(String key, String value) { if (null == this.arguments) { this.arguments = new java.util.HashMap(); } if (this.arguments.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.arguments.put(key, value); return this; } /** * Removes all the entries added into Arguments. * * @return Returns a reference to this object so that method calls can be chained together. */ public Action clearArgumentsEntries() { this.arguments = null; return this; } /** *

* The JobRun timeout in minutes. This is the maximum time that a job run can consume resources before * it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours). This overrides * the timeout value set in the parent job. *

* * @param timeout * The JobRun timeout in minutes. This is the maximum time that a job run can consume resources * before it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours). * This overrides the timeout value set in the parent job. */ public void setTimeout(Integer timeout) { this.timeout = timeout; } /** *

* The JobRun timeout in minutes. This is the maximum time that a job run can consume resources before * it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours). This overrides * the timeout value set in the parent job. *

* * @return The JobRun timeout in minutes. This is the maximum time that a job run can consume resources * before it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours). * This overrides the timeout value set in the parent job. */ public Integer getTimeout() { return this.timeout; } /** *

* The JobRun timeout in minutes. This is the maximum time that a job run can consume resources before * it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours). This overrides * the timeout value set in the parent job. *

* * @param timeout * The JobRun timeout in minutes. This is the maximum time that a job run can consume resources * before it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours). * This overrides the timeout value set in the parent job. * @return Returns a reference to this object so that method calls can be chained together. */ public Action withTimeout(Integer timeout) { setTimeout(timeout); return this; } /** *

* The name of the SecurityConfiguration structure to be used with this action. *

* * @param securityConfiguration * The name of the SecurityConfiguration structure to be used with this action. */ public void setSecurityConfiguration(String securityConfiguration) { this.securityConfiguration = securityConfiguration; } /** *

* The name of the SecurityConfiguration structure to be used with this action. *

* * @return The name of the SecurityConfiguration structure to be used with this action. */ public String getSecurityConfiguration() { return this.securityConfiguration; } /** *

* The name of the SecurityConfiguration structure to be used with this action. *

* * @param securityConfiguration * The name of the SecurityConfiguration structure to be used with this action. * @return Returns a reference to this object so that method calls can be chained together. */ public Action withSecurityConfiguration(String securityConfiguration) { setSecurityConfiguration(securityConfiguration); return this; } /** *

* Specifies configuration properties of a job run notification. *

* * @param notificationProperty * Specifies configuration properties of a job run notification. */ public void setNotificationProperty(NotificationProperty notificationProperty) { this.notificationProperty = notificationProperty; } /** *

* Specifies configuration properties of a job run notification. *

* * @return Specifies configuration properties of a job run notification. */ public NotificationProperty getNotificationProperty() { return this.notificationProperty; } /** *

* Specifies configuration properties of a job run notification. *

* * @param notificationProperty * Specifies configuration properties of a job run notification. * @return Returns a reference to this object so that method calls can be chained together. */ public Action withNotificationProperty(NotificationProperty notificationProperty) { setNotificationProperty(notificationProperty); return this; } /** *

* The name of the crawler to be used with this action. *

* * @param crawlerName * The name of the crawler to be used with this action. */ public void setCrawlerName(String crawlerName) { this.crawlerName = crawlerName; } /** *

* The name of the crawler to be used with this action. *

* * @return The name of the crawler to be used with this action. */ public String getCrawlerName() { return this.crawlerName; } /** *

* The name of the crawler to be used with this action. *

* * @param crawlerName * The name of the crawler to be used with this action. * @return Returns a reference to this object so that method calls can be chained together. */ public Action withCrawlerName(String crawlerName) { setCrawlerName(crawlerName); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getJobName() != null) sb.append("JobName: ").append(getJobName()).append(","); if (getArguments() != null) sb.append("Arguments: ").append(getArguments()).append(","); if (getTimeout() != null) sb.append("Timeout: ").append(getTimeout()).append(","); if (getSecurityConfiguration() != null) sb.append("SecurityConfiguration: ").append(getSecurityConfiguration()).append(","); if (getNotificationProperty() != null) sb.append("NotificationProperty: ").append(getNotificationProperty()).append(","); if (getCrawlerName() != null) sb.append("CrawlerName: ").append(getCrawlerName()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Action == false) return false; Action other = (Action) obj; if (other.getJobName() == null ^ this.getJobName() == null) return false; if (other.getJobName() != null && other.getJobName().equals(this.getJobName()) == false) return false; if (other.getArguments() == null ^ this.getArguments() == null) return false; if (other.getArguments() != null && other.getArguments().equals(this.getArguments()) == false) return false; if (other.getTimeout() == null ^ this.getTimeout() == null) return false; if (other.getTimeout() != null && other.getTimeout().equals(this.getTimeout()) == false) return false; if (other.getSecurityConfiguration() == null ^ this.getSecurityConfiguration() == null) return false; if (other.getSecurityConfiguration() != null && other.getSecurityConfiguration().equals(this.getSecurityConfiguration()) == false) return false; if (other.getNotificationProperty() == null ^ this.getNotificationProperty() == null) return false; if (other.getNotificationProperty() != null && other.getNotificationProperty().equals(this.getNotificationProperty()) == false) return false; if (other.getCrawlerName() == null ^ this.getCrawlerName() == null) return false; if (other.getCrawlerName() != null && other.getCrawlerName().equals(this.getCrawlerName()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getJobName() == null) ? 0 : getJobName().hashCode()); hashCode = prime * hashCode + ((getArguments() == null) ? 0 : getArguments().hashCode()); hashCode = prime * hashCode + ((getTimeout() == null) ? 0 : getTimeout().hashCode()); hashCode = prime * hashCode + ((getSecurityConfiguration() == null) ? 0 : getSecurityConfiguration().hashCode()); hashCode = prime * hashCode + ((getNotificationProperty() == null) ? 0 : getNotificationProperty().hashCode()); hashCode = prime * hashCode + ((getCrawlerName() == null) ? 0 : getCrawlerName().hashCode()); return hashCode; } @Override public Action clone() { try { return (Action) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.glue.model.transform.ActionMarshaller.getInstance().marshall(this, protocolMarshaller); } }