@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteAlarmsRequest == false) return false; DeleteAlarmsRequest other = (DeleteAlarmsRequest) obj; if (other.getAlarmNames() == null ^ this.getAlarmNames() == null) return false; if (other.getAlarmNames() != null && other.getAlarmNames().equals(this.getAlarmNames()) == false) return false; return true; }
/** * <p> * The alarms to be deleted. * </p> * * @param alarmNames * The alarms to be deleted. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteAlarmsRequest withAlarmNames(java.util.Collection<String> alarmNames) { setAlarmNames(alarmNames); return this; }
public static void main(String[] args) { final String USAGE = "To run this example, supply an alarm name\n" + "Ex: DeleteAlarm <alarm-name>\n"; if (args.length != 1) { System.out.println(USAGE); System.exit(1); } String alarm_name = args[0]; final AmazonCloudWatch cw = AmazonCloudWatchClientBuilder.defaultClient(); DeleteAlarmsRequest request = new DeleteAlarmsRequest() .withAlarmNames(alarm_name); DeleteAlarmsResult response = cw.deleteAlarms(request); System.out.printf("Successfully deleted alarm %s", alarm_name); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAlarmNames() == null) ? 0 : getAlarmNames().hashCode()); return hashCode; }
/** * <p> * The alarms to be deleted. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setAlarmNames(java.util.Collection)} or {@link #withAlarmNames(java.util.Collection)} if you want to * override the existing values. * </p> * * @param alarmNames * The alarms to be deleted. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteAlarmsRequest withAlarmNames(String... alarmNames) { if (this.alarmNames == null) { setAlarmNames(new com.amazonaws.internal.SdkInternalList<String>(alarmNames.length)); } for (String ele : alarmNames) { this.alarmNames.add(ele); } 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 (getAlarmNames() != null) sb.append("AlarmNames: ").append(getAlarmNames()); sb.append("}"); return sb.toString(); }
/** * <p> * A list of alarms to be deleted. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param alarmNames <p> * A list of alarms to be deleted. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public DeleteAlarmsRequest withAlarmNames(java.util.Collection<String> alarmNames) { setAlarmNames(alarmNames); return this; }
public Request<DeleteAlarmsRequest> marshall(DeleteAlarmsRequest deleteAlarmsRequest) { if (deleteAlarmsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<DeleteAlarmsRequest> request = new DefaultRequest<DeleteAlarmsRequest>(deleteAlarmsRequest, "AmazonCloudWatch"); request.addParameter("Action", "DeleteAlarms"); request.addParameter("Version", "2010-08-01"); request.setHttpMethod(HttpMethodName.POST); if (!deleteAlarmsRequest.getAlarmNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) deleteAlarmsRequest.getAlarmNames()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<String> alarmNamesList = (com.amazonaws.internal.SdkInternalList<String>) deleteAlarmsRequest .getAlarmNames(); int alarmNamesListIndex = 1; for (String alarmNamesListValue : alarmNamesList) { if (alarmNamesListValue != null) { request.addParameter("AlarmNames.member." + alarmNamesListIndex, StringUtils.fromString(alarmNamesListValue)); } alarmNamesListIndex++; } } return request; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAlarmNames() == null) ? 0 : getAlarmNames().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteAlarmsRequest == false) return false; DeleteAlarmsRequest other = (DeleteAlarmsRequest) obj; if (other.getAlarmNames() == null ^ this.getAlarmNames() == null) return false; if (other.getAlarmNames() != null && other.getAlarmNames().equals(this.getAlarmNames()) == false) return false; return true; } }
/** * 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 (getAlarmNames() != null) sb.append("AlarmNames: " + getAlarmNames()); sb.append("}"); return sb.toString(); }
/** * <p> * A list of alarms to be deleted. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param alarmNames <p> * A list of alarms to be deleted. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public DeleteAlarmsRequest withAlarmNames(String... alarmNames) { if (getAlarmNames() == null) { this.alarmNames = new java.util.ArrayList<String>(alarmNames.length); } for (String value : alarmNames) { this.alarmNames.add(value); } return this; }
public Request<DeleteAlarmsRequest> marshall(DeleteAlarmsRequest deleteAlarmsRequest) { if (deleteAlarmsRequest == null) { throw new AmazonClientException( "Invalid argument passed to marshall(DeleteAlarmsRequest)"); } Request<DeleteAlarmsRequest> request = new DefaultRequest<DeleteAlarmsRequest>( deleteAlarmsRequest, "AmazonCloudWatch"); request.addParameter("Action", "DeleteAlarms"); request.addParameter("Version", "2010-08-01"); String prefix; if (deleteAlarmsRequest.getAlarmNames() != null) { prefix = "AlarmNames"; java.util.List<String> alarmNames = deleteAlarmsRequest.getAlarmNames(); int alarmNamesIndex = 1; String alarmNamesPrefix = prefix; for (String alarmNamesItem : alarmNames) { prefix = alarmNamesPrefix + ".member." + alarmNamesIndex; if (alarmNamesItem != null) { request.addParameter(prefix, StringUtils.fromString(alarmNamesItem)); } alarmNamesIndex++; } prefix = alarmNamesPrefix; } return request; } }