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

* Information about the Shield Advanced subscription for an account. *

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

* The start time of the subscription, in Unix time in seconds. *

*/ private java.util.Date startTime; /** *

* The date and time your subscription will end. *

*/ private java.util.Date endTime; /** *

* The length, in seconds, of the Shield Advanced subscription for the account. *

*/ private Long timeCommitmentInSeconds; /** *

* If ENABLED, the subscription will be automatically renewed at the end of the existing subscription * period. *

*

* When you initally create a subscription, AutoRenew is set to ENABLED. You can change * this by submitting an UpdateSubscription request. If the UpdateSubscription request * does not included a value for AutoRenew, the existing value for AutoRenew remains * unchanged. *

*/ private String autoRenew; /** *

* Specifies how many protections of a given type you can create. *

*/ private java.util.List limits; /** *

* If ENABLED, the Shield Response Team (SRT) will use email and phone to notify contacts about * escalations to the SRT and to initiate proactive customer support. *

*

* If PENDING, you have requested proactive engagement and the request is pending. The status changes * to ENABLED when your request is fully processed. *

*

* If DISABLED, the SRT will not proactively notify contacts about escalations or to initiate proactive * customer support. *

*/ private String proactiveEngagementStatus; /** *

* Limits settings for your subscription. *

*/ private SubscriptionLimits subscriptionLimits; /** *

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

*/ private String subscriptionArn; /** *

* The start time of the subscription, in Unix time in seconds. *

* * @param startTime * The start time of the subscription, in Unix time in seconds. */ public void setStartTime(java.util.Date startTime) { this.startTime = startTime; } /** *

* The start time of the subscription, in Unix time in seconds. *

* * @return The start time of the subscription, in Unix time in seconds. */ public java.util.Date getStartTime() { return this.startTime; } /** *

* The start time of the subscription, in Unix time in seconds. *

* * @param startTime * The start time of the subscription, in Unix time in seconds. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withStartTime(java.util.Date startTime) { setStartTime(startTime); return this; } /** *

* The date and time your subscription will end. *

* * @param endTime * The date and time your subscription will end. */ public void setEndTime(java.util.Date endTime) { this.endTime = endTime; } /** *

* The date and time your subscription will end. *

* * @return The date and time your subscription will end. */ public java.util.Date getEndTime() { return this.endTime; } /** *

* The date and time your subscription will end. *

* * @param endTime * The date and time your subscription will end. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withEndTime(java.util.Date endTime) { setEndTime(endTime); return this; } /** *

* The length, in seconds, of the Shield Advanced subscription for the account. *

* * @param timeCommitmentInSeconds * The length, in seconds, of the Shield Advanced subscription for the account. */ public void setTimeCommitmentInSeconds(Long timeCommitmentInSeconds) { this.timeCommitmentInSeconds = timeCommitmentInSeconds; } /** *

* The length, in seconds, of the Shield Advanced subscription for the account. *

* * @return The length, in seconds, of the Shield Advanced subscription for the account. */ public Long getTimeCommitmentInSeconds() { return this.timeCommitmentInSeconds; } /** *

* The length, in seconds, of the Shield Advanced subscription for the account. *

* * @param timeCommitmentInSeconds * The length, in seconds, of the Shield Advanced subscription for the account. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withTimeCommitmentInSeconds(Long timeCommitmentInSeconds) { setTimeCommitmentInSeconds(timeCommitmentInSeconds); return this; } /** *

* If ENABLED, the subscription will be automatically renewed at the end of the existing subscription * period. *

*

* When you initally create a subscription, AutoRenew is set to ENABLED. You can change * this by submitting an UpdateSubscription request. If the UpdateSubscription request * does not included a value for AutoRenew, the existing value for AutoRenew remains * unchanged. *

* * @param autoRenew * If ENABLED, the subscription will be automatically renewed at the end of the existing * subscription period.

*

* When you initally create a subscription, AutoRenew is set to ENABLED. You can * change this by submitting an UpdateSubscription request. If the * UpdateSubscription request does not included a value for AutoRenew, the existing * value for AutoRenew remains unchanged. * @see AutoRenew */ public void setAutoRenew(String autoRenew) { this.autoRenew = autoRenew; } /** *

* If ENABLED, the subscription will be automatically renewed at the end of the existing subscription * period. *

*

* When you initally create a subscription, AutoRenew is set to ENABLED. You can change * this by submitting an UpdateSubscription request. If the UpdateSubscription request * does not included a value for AutoRenew, the existing value for AutoRenew remains * unchanged. *

* * @return If ENABLED, the subscription will be automatically renewed at the end of the existing * subscription period.

*

* When you initally create a subscription, AutoRenew is set to ENABLED. You can * change this by submitting an UpdateSubscription request. If the * UpdateSubscription request does not included a value for AutoRenew, the * existing value for AutoRenew remains unchanged. * @see AutoRenew */ public String getAutoRenew() { return this.autoRenew; } /** *

* If ENABLED, the subscription will be automatically renewed at the end of the existing subscription * period. *

*

* When you initally create a subscription, AutoRenew is set to ENABLED. You can change * this by submitting an UpdateSubscription request. If the UpdateSubscription request * does not included a value for AutoRenew, the existing value for AutoRenew remains * unchanged. *

* * @param autoRenew * If ENABLED, the subscription will be automatically renewed at the end of the existing * subscription period.

*

* When you initally create a subscription, AutoRenew is set to ENABLED. You can * change this by submitting an UpdateSubscription request. If the * UpdateSubscription request does not included a value for AutoRenew, the existing * value for AutoRenew remains unchanged. * @return Returns a reference to this object so that method calls can be chained together. * @see AutoRenew */ public Subscription withAutoRenew(String autoRenew) { setAutoRenew(autoRenew); return this; } /** *

* If ENABLED, the subscription will be automatically renewed at the end of the existing subscription * period. *

*

* When you initally create a subscription, AutoRenew is set to ENABLED. You can change * this by submitting an UpdateSubscription request. If the UpdateSubscription request * does not included a value for AutoRenew, the existing value for AutoRenew remains * unchanged. *

* * @param autoRenew * If ENABLED, the subscription will be automatically renewed at the end of the existing * subscription period.

*

* When you initally create a subscription, AutoRenew is set to ENABLED. You can * change this by submitting an UpdateSubscription request. If the * UpdateSubscription request does not included a value for AutoRenew, the existing * value for AutoRenew remains unchanged. * @return Returns a reference to this object so that method calls can be chained together. * @see AutoRenew */ public Subscription withAutoRenew(AutoRenew autoRenew) { this.autoRenew = autoRenew.toString(); return this; } /** *

* Specifies how many protections of a given type you can create. *

* * @return Specifies how many protections of a given type you can create. */ public java.util.List getLimits() { return limits; } /** *

* Specifies how many protections of a given type you can create. *

* * @param limits * Specifies how many protections of a given type you can create. */ public void setLimits(java.util.Collection limits) { if (limits == null) { this.limits = null; return; } this.limits = new java.util.ArrayList(limits); } /** *

* Specifies how many protections of a given type you can create. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setLimits(java.util.Collection)} or {@link #withLimits(java.util.Collection)} if you want to override the * existing values. *

* * @param limits * Specifies how many protections of a given type you can create. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withLimits(Limit... limits) { if (this.limits == null) { setLimits(new java.util.ArrayList(limits.length)); } for (Limit ele : limits) { this.limits.add(ele); } return this; } /** *

* Specifies how many protections of a given type you can create. *

* * @param limits * Specifies how many protections of a given type you can create. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withLimits(java.util.Collection limits) { setLimits(limits); return this; } /** *

* If ENABLED, the Shield Response Team (SRT) will use email and phone to notify contacts about * escalations to the SRT and to initiate proactive customer support. *

*

* If PENDING, you have requested proactive engagement and the request is pending. The status changes * to ENABLED when your request is fully processed. *

*

* If DISABLED, the SRT will not proactively notify contacts about escalations or to initiate proactive * customer support. *

* * @param proactiveEngagementStatus * If ENABLED, the Shield Response Team (SRT) will use email and phone to notify contacts about * escalations to the SRT and to initiate proactive customer support.

*

* If PENDING, you have requested proactive engagement and the request is pending. The status * changes to ENABLED when your request is fully processed. *

*

* If DISABLED, the SRT will not proactively notify contacts about escalations or to initiate * proactive customer support. * @see ProactiveEngagementStatus */ public void setProactiveEngagementStatus(String proactiveEngagementStatus) { this.proactiveEngagementStatus = proactiveEngagementStatus; } /** *

* If ENABLED, the Shield Response Team (SRT) will use email and phone to notify contacts about * escalations to the SRT and to initiate proactive customer support. *

*

* If PENDING, you have requested proactive engagement and the request is pending. The status changes * to ENABLED when your request is fully processed. *

*

* If DISABLED, the SRT will not proactively notify contacts about escalations or to initiate proactive * customer support. *

* * @return If ENABLED, the Shield Response Team (SRT) will use email and phone to notify contacts about * escalations to the SRT and to initiate proactive customer support.

*

* If PENDING, you have requested proactive engagement and the request is pending. The status * changes to ENABLED when your request is fully processed. *

*

* If DISABLED, the SRT will not proactively notify contacts about escalations or to initiate * proactive customer support. * @see ProactiveEngagementStatus */ public String getProactiveEngagementStatus() { return this.proactiveEngagementStatus; } /** *

* If ENABLED, the Shield Response Team (SRT) will use email and phone to notify contacts about * escalations to the SRT and to initiate proactive customer support. *

*

* If PENDING, you have requested proactive engagement and the request is pending. The status changes * to ENABLED when your request is fully processed. *

*

* If DISABLED, the SRT will not proactively notify contacts about escalations or to initiate proactive * customer support. *

* * @param proactiveEngagementStatus * If ENABLED, the Shield Response Team (SRT) will use email and phone to notify contacts about * escalations to the SRT and to initiate proactive customer support.

*

* If PENDING, you have requested proactive engagement and the request is pending. The status * changes to ENABLED when your request is fully processed. *

*

* If DISABLED, the SRT will not proactively notify contacts about escalations or to initiate * proactive customer support. * @return Returns a reference to this object so that method calls can be chained together. * @see ProactiveEngagementStatus */ public Subscription withProactiveEngagementStatus(String proactiveEngagementStatus) { setProactiveEngagementStatus(proactiveEngagementStatus); return this; } /** *

* If ENABLED, the Shield Response Team (SRT) will use email and phone to notify contacts about * escalations to the SRT and to initiate proactive customer support. *

*

* If PENDING, you have requested proactive engagement and the request is pending. The status changes * to ENABLED when your request is fully processed. *

*

* If DISABLED, the SRT will not proactively notify contacts about escalations or to initiate proactive * customer support. *

* * @param proactiveEngagementStatus * If ENABLED, the Shield Response Team (SRT) will use email and phone to notify contacts about * escalations to the SRT and to initiate proactive customer support.

*

* If PENDING, you have requested proactive engagement and the request is pending. The status * changes to ENABLED when your request is fully processed. *

*

* If DISABLED, the SRT will not proactively notify contacts about escalations or to initiate * proactive customer support. * @return Returns a reference to this object so that method calls can be chained together. * @see ProactiveEngagementStatus */ public Subscription withProactiveEngagementStatus(ProactiveEngagementStatus proactiveEngagementStatus) { this.proactiveEngagementStatus = proactiveEngagementStatus.toString(); return this; } /** *

* Limits settings for your subscription. *

* * @param subscriptionLimits * Limits settings for your subscription. */ public void setSubscriptionLimits(SubscriptionLimits subscriptionLimits) { this.subscriptionLimits = subscriptionLimits; } /** *

* Limits settings for your subscription. *

* * @return Limits settings for your subscription. */ public SubscriptionLimits getSubscriptionLimits() { return this.subscriptionLimits; } /** *

* Limits settings for your subscription. *

* * @param subscriptionLimits * Limits settings for your subscription. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withSubscriptionLimits(SubscriptionLimits subscriptionLimits) { setSubscriptionLimits(subscriptionLimits); return this; } /** *

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

* * @param subscriptionArn * The ARN (Amazon Resource Name) of the subscription. */ public void setSubscriptionArn(String subscriptionArn) { this.subscriptionArn = subscriptionArn; } /** *

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

* * @return The ARN (Amazon Resource Name) of the subscription. */ public String getSubscriptionArn() { return this.subscriptionArn; } /** *

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

* * @param subscriptionArn * The ARN (Amazon Resource Name) of the subscription. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withSubscriptionArn(String subscriptionArn) { setSubscriptionArn(subscriptionArn); 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 (getStartTime() != null) sb.append("StartTime: ").append(getStartTime()).append(","); if (getEndTime() != null) sb.append("EndTime: ").append(getEndTime()).append(","); if (getTimeCommitmentInSeconds() != null) sb.append("TimeCommitmentInSeconds: ").append(getTimeCommitmentInSeconds()).append(","); if (getAutoRenew() != null) sb.append("AutoRenew: ").append(getAutoRenew()).append(","); if (getLimits() != null) sb.append("Limits: ").append(getLimits()).append(","); if (getProactiveEngagementStatus() != null) sb.append("ProactiveEngagementStatus: ").append(getProactiveEngagementStatus()).append(","); if (getSubscriptionLimits() != null) sb.append("SubscriptionLimits: ").append(getSubscriptionLimits()).append(","); if (getSubscriptionArn() != null) sb.append("SubscriptionArn: ").append(getSubscriptionArn()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Subscription == false) return false; Subscription other = (Subscription) obj; if (other.getStartTime() == null ^ this.getStartTime() == null) return false; if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false) return false; if (other.getEndTime() == null ^ this.getEndTime() == null) return false; if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false) return false; if (other.getTimeCommitmentInSeconds() == null ^ this.getTimeCommitmentInSeconds() == null) return false; if (other.getTimeCommitmentInSeconds() != null && other.getTimeCommitmentInSeconds().equals(this.getTimeCommitmentInSeconds()) == false) return false; if (other.getAutoRenew() == null ^ this.getAutoRenew() == null) return false; if (other.getAutoRenew() != null && other.getAutoRenew().equals(this.getAutoRenew()) == false) return false; if (other.getLimits() == null ^ this.getLimits() == null) return false; if (other.getLimits() != null && other.getLimits().equals(this.getLimits()) == false) return false; if (other.getProactiveEngagementStatus() == null ^ this.getProactiveEngagementStatus() == null) return false; if (other.getProactiveEngagementStatus() != null && other.getProactiveEngagementStatus().equals(this.getProactiveEngagementStatus()) == false) return false; if (other.getSubscriptionLimits() == null ^ this.getSubscriptionLimits() == null) return false; if (other.getSubscriptionLimits() != null && other.getSubscriptionLimits().equals(this.getSubscriptionLimits()) == false) return false; if (other.getSubscriptionArn() == null ^ this.getSubscriptionArn() == null) return false; if (other.getSubscriptionArn() != null && other.getSubscriptionArn().equals(this.getSubscriptionArn()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); hashCode = prime * hashCode + ((getTimeCommitmentInSeconds() == null) ? 0 : getTimeCommitmentInSeconds().hashCode()); hashCode = prime * hashCode + ((getAutoRenew() == null) ? 0 : getAutoRenew().hashCode()); hashCode = prime * hashCode + ((getLimits() == null) ? 0 : getLimits().hashCode()); hashCode = prime * hashCode + ((getProactiveEngagementStatus() == null) ? 0 : getProactiveEngagementStatus().hashCode()); hashCode = prime * hashCode + ((getSubscriptionLimits() == null) ? 0 : getSubscriptionLimits().hashCode()); hashCode = prime * hashCode + ((getSubscriptionArn() == null) ? 0 : getSubscriptionArn().hashCode()); return hashCode; } @Override public Subscription clone() { try { return (Subscription) 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.shield.model.transform.SubscriptionMarshaller.getInstance().marshall(this, protocolMarshaller); } }