/* * 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.codedeploy.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** *

* Represents the input of a CreateDeploymentConfig operation. *

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

* The name of the deployment configuration to create. *

*/ private String deploymentConfigName; /** *

* The minimum number of healthy instances that should be available at any time during the deployment. There are two * parameters expected in the input: type and value. *

*

* The type parameter takes either of the following values: *

* *

* The value parameter takes an integer. *

*

* For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95. *

*/ private MinimumHealthyHosts minimumHealthyHosts; /** *

* The configuration that specifies how the deployment traffic is routed. *

*/ private TrafficRoutingConfig trafficRoutingConfig; /** *

* The destination platform type for the deployment (Lambda, Server, or ECS). *

*/ private String computePlatform; /** *

* The name of the deployment configuration to create. *

* * @param deploymentConfigName * The name of the deployment configuration to create. */ public void setDeploymentConfigName(String deploymentConfigName) { this.deploymentConfigName = deploymentConfigName; } /** *

* The name of the deployment configuration to create. *

* * @return The name of the deployment configuration to create. */ public String getDeploymentConfigName() { return this.deploymentConfigName; } /** *

* The name of the deployment configuration to create. *

* * @param deploymentConfigName * The name of the deployment configuration to create. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDeploymentConfigRequest withDeploymentConfigName(String deploymentConfigName) { setDeploymentConfigName(deploymentConfigName); return this; } /** *

* The minimum number of healthy instances that should be available at any time during the deployment. There are two * parameters expected in the input: type and value. *

*

* The type parameter takes either of the following values: *

* *

* The value parameter takes an integer. *

*

* For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95. *

* * @param minimumHealthyHosts * The minimum number of healthy instances that should be available at any time during the deployment. There * are two parameters expected in the input: type and value.

*

* The type parameter takes either of the following values: *

* *

* The value parameter takes an integer. *

*

* For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95. */ public void setMinimumHealthyHosts(MinimumHealthyHosts minimumHealthyHosts) { this.minimumHealthyHosts = minimumHealthyHosts; } /** *

* The minimum number of healthy instances that should be available at any time during the deployment. There are two * parameters expected in the input: type and value. *

*

* The type parameter takes either of the following values: *

* *

* The value parameter takes an integer. *

*

* For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95. *

* * @return The minimum number of healthy instances that should be available at any time during the deployment. There * are two parameters expected in the input: type and value.

*

* The type parameter takes either of the following values: *

* *

* The value parameter takes an integer. *

*

* For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95. */ public MinimumHealthyHosts getMinimumHealthyHosts() { return this.minimumHealthyHosts; } /** *

* The minimum number of healthy instances that should be available at any time during the deployment. There are two * parameters expected in the input: type and value. *

*

* The type parameter takes either of the following values: *

* *

* The value parameter takes an integer. *

*

* For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95. *

* * @param minimumHealthyHosts * The minimum number of healthy instances that should be available at any time during the deployment. There * are two parameters expected in the input: type and value.

*

* The type parameter takes either of the following values: *

* *

* The value parameter takes an integer. *

*

* For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDeploymentConfigRequest withMinimumHealthyHosts(MinimumHealthyHosts minimumHealthyHosts) { setMinimumHealthyHosts(minimumHealthyHosts); return this; } /** *

* The configuration that specifies how the deployment traffic is routed. *

* * @param trafficRoutingConfig * The configuration that specifies how the deployment traffic is routed. */ public void setTrafficRoutingConfig(TrafficRoutingConfig trafficRoutingConfig) { this.trafficRoutingConfig = trafficRoutingConfig; } /** *

* The configuration that specifies how the deployment traffic is routed. *

* * @return The configuration that specifies how the deployment traffic is routed. */ public TrafficRoutingConfig getTrafficRoutingConfig() { return this.trafficRoutingConfig; } /** *

* The configuration that specifies how the deployment traffic is routed. *

* * @param trafficRoutingConfig * The configuration that specifies how the deployment traffic is routed. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDeploymentConfigRequest withTrafficRoutingConfig(TrafficRoutingConfig trafficRoutingConfig) { setTrafficRoutingConfig(trafficRoutingConfig); return this; } /** *

* The destination platform type for the deployment (Lambda, Server, or ECS). *

* * @param computePlatform * The destination platform type for the deployment (Lambda, Server, or * ECS). * @see ComputePlatform */ public void setComputePlatform(String computePlatform) { this.computePlatform = computePlatform; } /** *

* The destination platform type for the deployment (Lambda, Server, or ECS). *

* * @return The destination platform type for the deployment (Lambda, Server, or * ECS). * @see ComputePlatform */ public String getComputePlatform() { return this.computePlatform; } /** *

* The destination platform type for the deployment (Lambda, Server, or ECS). *

* * @param computePlatform * The destination platform type for the deployment (Lambda, Server, or * ECS). * @return Returns a reference to this object so that method calls can be chained together. * @see ComputePlatform */ public CreateDeploymentConfigRequest withComputePlatform(String computePlatform) { setComputePlatform(computePlatform); return this; } /** *

* The destination platform type for the deployment (Lambda, Server, or ECS). *

* * @param computePlatform * The destination platform type for the deployment (Lambda, Server, or * ECS). * @return Returns a reference to this object so that method calls can be chained together. * @see ComputePlatform */ public CreateDeploymentConfigRequest withComputePlatform(ComputePlatform computePlatform) { this.computePlatform = computePlatform.toString(); 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 (getDeploymentConfigName() != null) sb.append("DeploymentConfigName: ").append(getDeploymentConfigName()).append(","); if (getMinimumHealthyHosts() != null) sb.append("MinimumHealthyHosts: ").append(getMinimumHealthyHosts()).append(","); if (getTrafficRoutingConfig() != null) sb.append("TrafficRoutingConfig: ").append(getTrafficRoutingConfig()).append(","); if (getComputePlatform() != null) sb.append("ComputePlatform: ").append(getComputePlatform()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateDeploymentConfigRequest == false) return false; CreateDeploymentConfigRequest other = (CreateDeploymentConfigRequest) obj; if (other.getDeploymentConfigName() == null ^ this.getDeploymentConfigName() == null) return false; if (other.getDeploymentConfigName() != null && other.getDeploymentConfigName().equals(this.getDeploymentConfigName()) == false) return false; if (other.getMinimumHealthyHosts() == null ^ this.getMinimumHealthyHosts() == null) return false; if (other.getMinimumHealthyHosts() != null && other.getMinimumHealthyHosts().equals(this.getMinimumHealthyHosts()) == false) return false; if (other.getTrafficRoutingConfig() == null ^ this.getTrafficRoutingConfig() == null) return false; if (other.getTrafficRoutingConfig() != null && other.getTrafficRoutingConfig().equals(this.getTrafficRoutingConfig()) == false) return false; if (other.getComputePlatform() == null ^ this.getComputePlatform() == null) return false; if (other.getComputePlatform() != null && other.getComputePlatform().equals(this.getComputePlatform()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDeploymentConfigName() == null) ? 0 : getDeploymentConfigName().hashCode()); hashCode = prime * hashCode + ((getMinimumHealthyHosts() == null) ? 0 : getMinimumHealthyHosts().hashCode()); hashCode = prime * hashCode + ((getTrafficRoutingConfig() == null) ? 0 : getTrafficRoutingConfig().hashCode()); hashCode = prime * hashCode + ((getComputePlatform() == null) ? 0 : getComputePlatform().hashCode()); return hashCode; } @Override public CreateDeploymentConfigRequest clone() { return (CreateDeploymentConfigRequest) super.clone(); } }