/* * 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.proton.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdateServiceInstanceRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The client token of the service instance to update. *

*/ private String clientToken; /** *

* The deployment type. It defines the mode for updating a service instance, as follows: *

*
*
*
*

* NONE *

*

* In this mode, a deployment doesn't occur. Only the requested metadata parameters are updated. *

*
*
*
*

* CURRENT_VERSION *

*

* In this mode, the service instance is deployed and updated with the new spec that you provide. Only requested * parameters are updated. Don’t include major or minor version parameters when you use this deployment type. *

*
*
*
*

* MINOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) minor version * of the current major version in use, by default. You can also specify a different minor version of the current * major version in use. *

*
*
*
*

* MAJOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) major and * minor version of the current template, by default. You can specify a different major version that's higher than * the major version in use and a minor version. *

*
*
*/ private String deploymentType; /** *

* The name of the service instance to update. *

*/ private String name; /** *

* The name of the service that the service instance belongs to. *

*/ private String serviceName; /** *

* The formatted specification that defines the service instance update. *

*/ private String spec; /** *

* The major version of the service template to update. *

*/ private String templateMajorVersion; /** *

* The minor version of the service template to update. *

*/ private String templateMinorVersion; /** *

* The client token of the service instance to update. *

* * @param clientToken * The client token of the service instance to update. */ public void setClientToken(String clientToken) { this.clientToken = clientToken; } /** *

* The client token of the service instance to update. *

* * @return The client token of the service instance to update. */ public String getClientToken() { return this.clientToken; } /** *

* The client token of the service instance to update. *

* * @param clientToken * The client token of the service instance to update. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateServiceInstanceRequest withClientToken(String clientToken) { setClientToken(clientToken); return this; } /** *

* The deployment type. It defines the mode for updating a service instance, as follows: *

*
*
*
*

* NONE *

*

* In this mode, a deployment doesn't occur. Only the requested metadata parameters are updated. *

*
*
*
*

* CURRENT_VERSION *

*

* In this mode, the service instance is deployed and updated with the new spec that you provide. Only requested * parameters are updated. Don’t include major or minor version parameters when you use this deployment type. *

*
*
*
*

* MINOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) minor version * of the current major version in use, by default. You can also specify a different minor version of the current * major version in use. *

*
*
*
*

* MAJOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) major and * minor version of the current template, by default. You can specify a different major version that's higher than * the major version in use and a minor version. *

*
*
* * @param deploymentType * The deployment type. It defines the mode for updating a service instance, as follows:

*
*
*
*

* NONE *

*

* In this mode, a deployment doesn't occur. Only the requested metadata parameters are updated. *

*
*
*
*

* CURRENT_VERSION *

*

* In this mode, the service instance is deployed and updated with the new spec that you provide. Only * requested parameters are updated. Don’t include major or minor version parameters when you use this * deployment type. *

*
*
*
*

* MINOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) minor * version of the current major version in use, by default. You can also specify a different minor version of * the current major version in use. *

*
*
*
*

* MAJOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) major * and minor version of the current template, by default. You can specify a different major version that's * higher than the major version in use and a minor version. *

*
* @see DeploymentUpdateType */ public void setDeploymentType(String deploymentType) { this.deploymentType = deploymentType; } /** *

* The deployment type. It defines the mode for updating a service instance, as follows: *

*
*
*
*

* NONE *

*

* In this mode, a deployment doesn't occur. Only the requested metadata parameters are updated. *

*
*
*
*

* CURRENT_VERSION *

*

* In this mode, the service instance is deployed and updated with the new spec that you provide. Only requested * parameters are updated. Don’t include major or minor version parameters when you use this deployment type. *

*
*
*
*

* MINOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) minor version * of the current major version in use, by default. You can also specify a different minor version of the current * major version in use. *

*
*
*
*

* MAJOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) major and * minor version of the current template, by default. You can specify a different major version that's higher than * the major version in use and a minor version. *

*
*
* * @return The deployment type. It defines the mode for updating a service instance, as follows:

*
*
*
*

* NONE *

*

* In this mode, a deployment doesn't occur. Only the requested metadata parameters are updated. *

*
*
*
*

* CURRENT_VERSION *

*

* In this mode, the service instance is deployed and updated with the new spec that you provide. Only * requested parameters are updated. Don’t include major or minor version parameters when you use * this deployment type. *

*
*
*
*

* MINOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) minor * version of the current major version in use, by default. You can also specify a different minor version * of the current major version in use. *

*
*
*
*

* MAJOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) major * and minor version of the current template, by default. You can specify a different major version that's * higher than the major version in use and a minor version. *

*
* @see DeploymentUpdateType */ public String getDeploymentType() { return this.deploymentType; } /** *

* The deployment type. It defines the mode for updating a service instance, as follows: *

*
*
*
*

* NONE *

*

* In this mode, a deployment doesn't occur. Only the requested metadata parameters are updated. *

*
*
*
*

* CURRENT_VERSION *

*

* In this mode, the service instance is deployed and updated with the new spec that you provide. Only requested * parameters are updated. Don’t include major or minor version parameters when you use this deployment type. *

*
*
*
*

* MINOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) minor version * of the current major version in use, by default. You can also specify a different minor version of the current * major version in use. *

*
*
*
*

* MAJOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) major and * minor version of the current template, by default. You can specify a different major version that's higher than * the major version in use and a minor version. *

*
*
* * @param deploymentType * The deployment type. It defines the mode for updating a service instance, as follows:

*
*
*
*

* NONE *

*

* In this mode, a deployment doesn't occur. Only the requested metadata parameters are updated. *

*
*
*
*

* CURRENT_VERSION *

*

* In this mode, the service instance is deployed and updated with the new spec that you provide. Only * requested parameters are updated. Don’t include major or minor version parameters when you use this * deployment type. *

*
*
*
*

* MINOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) minor * version of the current major version in use, by default. You can also specify a different minor version of * the current major version in use. *

*
*
*
*

* MAJOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) major * and minor version of the current template, by default. You can specify a different major version that's * higher than the major version in use and a minor version. *

*
* @return Returns a reference to this object so that method calls can be chained together. * @see DeploymentUpdateType */ public UpdateServiceInstanceRequest withDeploymentType(String deploymentType) { setDeploymentType(deploymentType); return this; } /** *

* The deployment type. It defines the mode for updating a service instance, as follows: *

*
*
*
*

* NONE *

*

* In this mode, a deployment doesn't occur. Only the requested metadata parameters are updated. *

*
*
*
*

* CURRENT_VERSION *

*

* In this mode, the service instance is deployed and updated with the new spec that you provide. Only requested * parameters are updated. Don’t include major or minor version parameters when you use this deployment type. *

*
*
*
*

* MINOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) minor version * of the current major version in use, by default. You can also specify a different minor version of the current * major version in use. *

*
*
*
*

* MAJOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) major and * minor version of the current template, by default. You can specify a different major version that's higher than * the major version in use and a minor version. *

*
*
* * @param deploymentType * The deployment type. It defines the mode for updating a service instance, as follows:

*
*
*
*

* NONE *

*

* In this mode, a deployment doesn't occur. Only the requested metadata parameters are updated. *

*
*
*
*

* CURRENT_VERSION *

*

* In this mode, the service instance is deployed and updated with the new spec that you provide. Only * requested parameters are updated. Don’t include major or minor version parameters when you use this * deployment type. *

*
*
*
*

* MINOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) minor * version of the current major version in use, by default. You can also specify a different minor version of * the current major version in use. *

*
*
*
*

* MAJOR_VERSION *

*

* In this mode, the service instance is deployed and updated with the published, recommended (latest) major * and minor version of the current template, by default. You can specify a different major version that's * higher than the major version in use and a minor version. *

*
* @return Returns a reference to this object so that method calls can be chained together. * @see DeploymentUpdateType */ public UpdateServiceInstanceRequest withDeploymentType(DeploymentUpdateType deploymentType) { this.deploymentType = deploymentType.toString(); return this; } /** *

* The name of the service instance to update. *

* * @param name * The name of the service instance to update. */ public void setName(String name) { this.name = name; } /** *

* The name of the service instance to update. *

* * @return The name of the service instance to update. */ public String getName() { return this.name; } /** *

* The name of the service instance to update. *

* * @param name * The name of the service instance to update. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateServiceInstanceRequest withName(String name) { setName(name); return this; } /** *

* The name of the service that the service instance belongs to. *

* * @param serviceName * The name of the service that the service instance belongs to. */ public void setServiceName(String serviceName) { this.serviceName = serviceName; } /** *

* The name of the service that the service instance belongs to. *

* * @return The name of the service that the service instance belongs to. */ public String getServiceName() { return this.serviceName; } /** *

* The name of the service that the service instance belongs to. *

* * @param serviceName * The name of the service that the service instance belongs to. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateServiceInstanceRequest withServiceName(String serviceName) { setServiceName(serviceName); return this; } /** *

* The formatted specification that defines the service instance update. *

* * @param spec * The formatted specification that defines the service instance update. */ public void setSpec(String spec) { this.spec = spec; } /** *

* The formatted specification that defines the service instance update. *

* * @return The formatted specification that defines the service instance update. */ public String getSpec() { return this.spec; } /** *

* The formatted specification that defines the service instance update. *

* * @param spec * The formatted specification that defines the service instance update. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateServiceInstanceRequest withSpec(String spec) { setSpec(spec); return this; } /** *

* The major version of the service template to update. *

* * @param templateMajorVersion * The major version of the service template to update. */ public void setTemplateMajorVersion(String templateMajorVersion) { this.templateMajorVersion = templateMajorVersion; } /** *

* The major version of the service template to update. *

* * @return The major version of the service template to update. */ public String getTemplateMajorVersion() { return this.templateMajorVersion; } /** *

* The major version of the service template to update. *

* * @param templateMajorVersion * The major version of the service template to update. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateServiceInstanceRequest withTemplateMajorVersion(String templateMajorVersion) { setTemplateMajorVersion(templateMajorVersion); return this; } /** *

* The minor version of the service template to update. *

* * @param templateMinorVersion * The minor version of the service template to update. */ public void setTemplateMinorVersion(String templateMinorVersion) { this.templateMinorVersion = templateMinorVersion; } /** *

* The minor version of the service template to update. *

* * @return The minor version of the service template to update. */ public String getTemplateMinorVersion() { return this.templateMinorVersion; } /** *

* The minor version of the service template to update. *

* * @param templateMinorVersion * The minor version of the service template to update. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateServiceInstanceRequest withTemplateMinorVersion(String templateMinorVersion) { setTemplateMinorVersion(templateMinorVersion); 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 (getClientToken() != null) sb.append("ClientToken: ").append(getClientToken()).append(","); if (getDeploymentType() != null) sb.append("DeploymentType: ").append(getDeploymentType()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getServiceName() != null) sb.append("ServiceName: ").append(getServiceName()).append(","); if (getSpec() != null) sb.append("Spec: ").append("***Sensitive Data Redacted***").append(","); if (getTemplateMajorVersion() != null) sb.append("TemplateMajorVersion: ").append(getTemplateMajorVersion()).append(","); if (getTemplateMinorVersion() != null) sb.append("TemplateMinorVersion: ").append(getTemplateMinorVersion()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateServiceInstanceRequest == false) return false; UpdateServiceInstanceRequest other = (UpdateServiceInstanceRequest) obj; if (other.getClientToken() == null ^ this.getClientToken() == null) return false; if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false) return false; if (other.getDeploymentType() == null ^ this.getDeploymentType() == null) return false; if (other.getDeploymentType() != null && other.getDeploymentType().equals(this.getDeploymentType()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getServiceName() == null ^ this.getServiceName() == null) return false; if (other.getServiceName() != null && other.getServiceName().equals(this.getServiceName()) == false) return false; if (other.getSpec() == null ^ this.getSpec() == null) return false; if (other.getSpec() != null && other.getSpec().equals(this.getSpec()) == false) return false; if (other.getTemplateMajorVersion() == null ^ this.getTemplateMajorVersion() == null) return false; if (other.getTemplateMajorVersion() != null && other.getTemplateMajorVersion().equals(this.getTemplateMajorVersion()) == false) return false; if (other.getTemplateMinorVersion() == null ^ this.getTemplateMinorVersion() == null) return false; if (other.getTemplateMinorVersion() != null && other.getTemplateMinorVersion().equals(this.getTemplateMinorVersion()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); hashCode = prime * hashCode + ((getDeploymentType() == null) ? 0 : getDeploymentType().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getServiceName() == null) ? 0 : getServiceName().hashCode()); hashCode = prime * hashCode + ((getSpec() == null) ? 0 : getSpec().hashCode()); hashCode = prime * hashCode + ((getTemplateMajorVersion() == null) ? 0 : getTemplateMajorVersion().hashCode()); hashCode = prime * hashCode + ((getTemplateMinorVersion() == null) ? 0 : getTemplateMinorVersion().hashCode()); return hashCode; } @Override public UpdateServiceInstanceRequest clone() { return (UpdateServiceInstanceRequest) super.clone(); } }