/* * Copyright 2010-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.iot.model; import java.io.Serializable; /** *

* Sends message data to an IoT Analytics channel. *

*/ public class IotAnalyticsAction implements Serializable { /** *

* (deprecated) The ARN of the IoT Analytics channel to which message data * will be sent. *

*/ private String channelArn; /** *

* The name of the IoT Analytics channel to which message data will be sent. *

*/ private String channelName; /** *

* Whether to process the action as a batch. The default value is * false. *

*

* When batchMode is true and the rule SQL * statement evaluates to an Array, each Array element is delivered as a * separate message when passed by BatchPutMessage to the IoT Analytics channel. The * resulting array can't have more than 100 messages. *

*/ private Boolean batchMode; /** *

* The ARN of the role which has a policy that grants IoT Analytics * permission to send message data via IoT Analytics * (iotanalytics:BatchPutMessage). *

*/ private String roleArn; /** *

* (deprecated) The ARN of the IoT Analytics channel to which message data * will be sent. *

* * @return

* (deprecated) The ARN of the IoT Analytics channel to which * message data will be sent. *

*/ public String getChannelArn() { return channelArn; } /** *

* (deprecated) The ARN of the IoT Analytics channel to which message data * will be sent. *

* * @param channelArn

* (deprecated) The ARN of the IoT Analytics channel to which * message data will be sent. *

*/ public void setChannelArn(String channelArn) { this.channelArn = channelArn; } /** *

* (deprecated) The ARN of the IoT Analytics channel to which message data * will be sent. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param channelArn

* (deprecated) The ARN of the IoT Analytics channel to which * message data will be sent. *

* @return A reference to this updated object so that method calls can be * chained together. */ public IotAnalyticsAction withChannelArn(String channelArn) { this.channelArn = channelArn; return this; } /** *

* The name of the IoT Analytics channel to which message data will be sent. *

* * @return

* The name of the IoT Analytics channel to which message data will * be sent. *

*/ public String getChannelName() { return channelName; } /** *

* The name of the IoT Analytics channel to which message data will be sent. *

* * @param channelName

* The name of the IoT Analytics channel to which message data * will be sent. *

*/ public void setChannelName(String channelName) { this.channelName = channelName; } /** *

* The name of the IoT Analytics channel to which message data will be sent. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param channelName

* The name of the IoT Analytics channel to which message data * will be sent. *

* @return A reference to this updated object so that method calls can be * chained together. */ public IotAnalyticsAction withChannelName(String channelName) { this.channelName = channelName; return this; } /** *

* Whether to process the action as a batch. The default value is * false. *

*

* When batchMode is true and the rule SQL * statement evaluates to an Array, each Array element is delivered as a * separate message when passed by BatchPutMessage to the IoT Analytics channel. The * resulting array can't have more than 100 messages. *

* * @return

* Whether to process the action as a batch. The default value is * false. *

*

* When batchMode is true and the rule SQL * statement evaluates to an Array, each Array element is delivered * as a separate message when passed by BatchPutMessage to the IoT Analytics channel. * The resulting array can't have more than 100 messages. *

*/ public Boolean isBatchMode() { return batchMode; } /** *

* Whether to process the action as a batch. The default value is * false. *

*

* When batchMode is true and the rule SQL * statement evaluates to an Array, each Array element is delivered as a * separate message when passed by BatchPutMessage to the IoT Analytics channel. The * resulting array can't have more than 100 messages. *

* * @return

* Whether to process the action as a batch. The default value is * false. *

*

* When batchMode is true and the rule SQL * statement evaluates to an Array, each Array element is delivered * as a separate message when passed by BatchPutMessage to the IoT Analytics channel. * The resulting array can't have more than 100 messages. *

*/ public Boolean getBatchMode() { return batchMode; } /** *

* Whether to process the action as a batch. The default value is * false. *

*

* When batchMode is true and the rule SQL * statement evaluates to an Array, each Array element is delivered as a * separate message when passed by BatchPutMessage to the IoT Analytics channel. The * resulting array can't have more than 100 messages. *

* * @param batchMode

* Whether to process the action as a batch. The default value is * false. *

*

* When batchMode is true and the rule * SQL statement evaluates to an Array, each Array element is * delivered as a separate message when passed by BatchPutMessage to the IoT Analytics * channel. The resulting array can't have more than 100 * messages. *

*/ public void setBatchMode(Boolean batchMode) { this.batchMode = batchMode; } /** *

* Whether to process the action as a batch. The default value is * false. *

*

* When batchMode is true and the rule SQL * statement evaluates to an Array, each Array element is delivered as a * separate message when passed by BatchPutMessage to the IoT Analytics channel. The * resulting array can't have more than 100 messages. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param batchMode

* Whether to process the action as a batch. The default value is * false. *

*

* When batchMode is true and the rule * SQL statement evaluates to an Array, each Array element is * delivered as a separate message when passed by BatchPutMessage to the IoT Analytics * channel. The resulting array can't have more than 100 * messages. *

* @return A reference to this updated object so that method calls can be * chained together. */ public IotAnalyticsAction withBatchMode(Boolean batchMode) { this.batchMode = batchMode; return this; } /** *

* The ARN of the role which has a policy that grants IoT Analytics * permission to send message data via IoT Analytics * (iotanalytics:BatchPutMessage). *

* * @return

* The ARN of the role which has a policy that grants IoT Analytics * permission to send message data via IoT Analytics * (iotanalytics:BatchPutMessage). *

*/ public String getRoleArn() { return roleArn; } /** *

* The ARN of the role which has a policy that grants IoT Analytics * permission to send message data via IoT Analytics * (iotanalytics:BatchPutMessage). *

* * @param roleArn

* The ARN of the role which has a policy that grants IoT * Analytics permission to send message data via IoT Analytics * (iotanalytics:BatchPutMessage). *

*/ public void setRoleArn(String roleArn) { this.roleArn = roleArn; } /** *

* The ARN of the role which has a policy that grants IoT Analytics * permission to send message data via IoT Analytics * (iotanalytics:BatchPutMessage). *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param roleArn

* The ARN of the role which has a policy that grants IoT * Analytics permission to send message data via IoT Analytics * (iotanalytics:BatchPutMessage). *

* @return A reference to this updated object so that method calls can be * chained together. */ public IotAnalyticsAction withRoleArn(String roleArn) { this.roleArn = roleArn; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getChannelArn() != null) sb.append("channelArn: " + getChannelArn() + ","); if (getChannelName() != null) sb.append("channelName: " + getChannelName() + ","); if (getBatchMode() != null) sb.append("batchMode: " + getBatchMode() + ","); if (getRoleArn() != null) sb.append("roleArn: " + getRoleArn()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getChannelArn() == null) ? 0 : getChannelArn().hashCode()); hashCode = prime * hashCode + ((getChannelName() == null) ? 0 : getChannelName().hashCode()); hashCode = prime * hashCode + ((getBatchMode() == null) ? 0 : getBatchMode().hashCode()); hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof IotAnalyticsAction == false) return false; IotAnalyticsAction other = (IotAnalyticsAction) obj; if (other.getChannelArn() == null ^ this.getChannelArn() == null) return false; if (other.getChannelArn() != null && other.getChannelArn().equals(this.getChannelArn()) == false) return false; if (other.getChannelName() == null ^ this.getChannelName() == null) return false; if (other.getChannelName() != null && other.getChannelName().equals(this.getChannelName()) == false) return false; if (other.getBatchMode() == null ^ this.getBatchMode() == null) return false; if (other.getBatchMode() != null && other.getBatchMode().equals(this.getBatchMode()) == false) return false; if (other.getRoleArn() == null ^ this.getRoleArn() == null) return false; if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false) return false; return true; } }