/* * 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; import com.amazonaws.AmazonWebServiceRequest; /** *
* Updates a provisioning template. *
** Requires permission to access the UpdateProvisioningTemplate action. *
*/ public class UpdateProvisioningTemplateRequest extends AmazonWebServiceRequest implements Serializable { /** ** The name of the provisioning template. *
*
* Constraints:
* Length: 1 - 36
* Pattern: ^[0-9A-Za-z_-]+$
*/
private String templateName;
/**
*
* The description of the provisioning template. *
*
* Constraints:
* Length: 0 - 500
* Pattern: [^\p{C}]*
*/
private String description;
/**
*
* True to enable the provisioning template, otherwise false. *
*/ private Boolean enabled; /** ** The ID of the default provisioning template version. *
*/ private Integer defaultVersionId; /** ** The ARN of the role associated with the provisioning template. This IoT * role grants permission to provision a device. *
*
* Constraints:
* Length: 20 - 2048
*/
private String provisioningRoleArn;
/**
*
* Updates the pre-provisioning hook template. Only supports template of
* type FLEET_PROVISIONING
. For more information about
* provisioning template types, see type.
*
* Removes pre-provisioning hook template. *
*/ private Boolean removePreProvisioningHook; /** ** The name of the provisioning template. *
*
* Constraints:
* Length: 1 - 36
* Pattern: ^[0-9A-Za-z_-]+$
*
* @return
* The name of the provisioning template. *
*/ public String getTemplateName() { return templateName; } /** ** The name of the provisioning template. *
*
* Constraints:
* Length: 1 - 36
* Pattern: ^[0-9A-Za-z_-]+$
*
* @param templateName
* The name of the provisioning template. *
*/ public void setTemplateName(String templateName) { this.templateName = templateName; } /** ** The name of the provisioning template. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 36
* Pattern: ^[0-9A-Za-z_-]+$
*
* @param templateName
* The name of the provisioning template. *
* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateProvisioningTemplateRequest withTemplateName(String templateName) { this.templateName = templateName; return this; } /** ** The description of the provisioning template. *
*
* Constraints:
* Length: 0 - 500
* Pattern: [^\p{C}]*
*
* @return
* The description of the provisioning template. *
*/ public String getDescription() { return description; } /** ** The description of the provisioning template. *
*
* Constraints:
* Length: 0 - 500
* Pattern: [^\p{C}]*
*
* @param description
* The description of the provisioning template. *
*/ public void setDescription(String description) { this.description = description; } /** ** The description of the provisioning template. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0 - 500
* Pattern: [^\p{C}]*
*
* @param description
* The description of the provisioning template. *
* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateProvisioningTemplateRequest withDescription(String description) { this.description = description; return this; } /** ** True to enable the provisioning template, otherwise false. *
* * @return* True to enable the provisioning template, otherwise false. *
*/ public Boolean isEnabled() { return enabled; } /** ** True to enable the provisioning template, otherwise false. *
* * @return* True to enable the provisioning template, otherwise false. *
*/ public Boolean getEnabled() { return enabled; } /** ** True to enable the provisioning template, otherwise false. *
* * @param enabled* True to enable the provisioning template, otherwise false. *
*/ public void setEnabled(Boolean enabled) { this.enabled = enabled; } /** ** True to enable the provisioning template, otherwise false. *
** Returns a reference to this object so that method calls can be chained * together. * * @param enabled
* True to enable the provisioning template, otherwise false. *
* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateProvisioningTemplateRequest withEnabled(Boolean enabled) { this.enabled = enabled; return this; } /** ** The ID of the default provisioning template version. *
* * @return* The ID of the default provisioning template version. *
*/ public Integer getDefaultVersionId() { return defaultVersionId; } /** ** The ID of the default provisioning template version. *
* * @param defaultVersionId* The ID of the default provisioning template version. *
*/ public void setDefaultVersionId(Integer defaultVersionId) { this.defaultVersionId = defaultVersionId; } /** ** The ID of the default provisioning template version. *
** Returns a reference to this object so that method calls can be chained * together. * * @param defaultVersionId
* The ID of the default provisioning template version. *
* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateProvisioningTemplateRequest withDefaultVersionId(Integer defaultVersionId) { this.defaultVersionId = defaultVersionId; return this; } /** ** The ARN of the role associated with the provisioning template. This IoT * role grants permission to provision a device. *
*
* Constraints:
* Length: 20 - 2048
*
* @return
* The ARN of the role associated with the provisioning template. * This IoT role grants permission to provision a device. *
*/ public String getProvisioningRoleArn() { return provisioningRoleArn; } /** ** The ARN of the role associated with the provisioning template. This IoT * role grants permission to provision a device. *
*
* Constraints:
* Length: 20 - 2048
*
* @param provisioningRoleArn
* The ARN of the role associated with the provisioning template. * This IoT role grants permission to provision a device. *
*/ public void setProvisioningRoleArn(String provisioningRoleArn) { this.provisioningRoleArn = provisioningRoleArn; } /** ** The ARN of the role associated with the provisioning template. This IoT * role grants permission to provision a device. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 20 - 2048
*
* @param provisioningRoleArn
* The ARN of the role associated with the provisioning template. * This IoT role grants permission to provision a device. *
* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateProvisioningTemplateRequest withProvisioningRoleArn(String provisioningRoleArn) { this.provisioningRoleArn = provisioningRoleArn; return this; } /** *
* Updates the pre-provisioning hook template. Only supports template of
* type FLEET_PROVISIONING
. For more information about
* provisioning template types, see type.
*
* Updates the pre-provisioning hook template. Only supports
* template of type FLEET_PROVISIONING
. For more
* information about provisioning template types, see type.
*
* Updates the pre-provisioning hook template. Only supports template of
* type FLEET_PROVISIONING
. For more information about
* provisioning template types, see type.
*
* Updates the pre-provisioning hook template. Only supports
* template of type FLEET_PROVISIONING
. For more
* information about provisioning template types, see type.
*
* Updates the pre-provisioning hook template. Only supports template of
* type FLEET_PROVISIONING
. For more information about
* provisioning template types, see type.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param preProvisioningHook
* Updates the pre-provisioning hook template. Only supports
* template of type FLEET_PROVISIONING
. For more
* information about provisioning template types, see type.
*
* Removes pre-provisioning hook template. *
* * @return* Removes pre-provisioning hook template. *
*/ public Boolean isRemovePreProvisioningHook() { return removePreProvisioningHook; } /** ** Removes pre-provisioning hook template. *
* * @return* Removes pre-provisioning hook template. *
*/ public Boolean getRemovePreProvisioningHook() { return removePreProvisioningHook; } /** ** Removes pre-provisioning hook template. *
* * @param removePreProvisioningHook* Removes pre-provisioning hook template. *
*/ public void setRemovePreProvisioningHook(Boolean removePreProvisioningHook) { this.removePreProvisioningHook = removePreProvisioningHook; } /** ** Removes pre-provisioning hook template. *
** Returns a reference to this object so that method calls can be chained * together. * * @param removePreProvisioningHook
* Removes pre-provisioning hook template. *
* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateProvisioningTemplateRequest withRemovePreProvisioningHook( Boolean removePreProvisioningHook) { this.removePreProvisioningHook = removePreProvisioningHook; 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 (getTemplateName() != null) sb.append("templateName: " + getTemplateName() + ","); if (getDescription() != null) sb.append("description: " + getDescription() + ","); if (getEnabled() != null) sb.append("enabled: " + getEnabled() + ","); if (getDefaultVersionId() != null) sb.append("defaultVersionId: " + getDefaultVersionId() + ","); if (getProvisioningRoleArn() != null) sb.append("provisioningRoleArn: " + getProvisioningRoleArn() + ","); if (getPreProvisioningHook() != null) sb.append("preProvisioningHook: " + getPreProvisioningHook() + ","); if (getRemovePreProvisioningHook() != null) sb.append("removePreProvisioningHook: " + getRemovePreProvisioningHook()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTemplateName() == null) ? 0 : getTemplateName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode()); hashCode = prime * hashCode + ((getDefaultVersionId() == null) ? 0 : getDefaultVersionId().hashCode()); hashCode = prime * hashCode + ((getProvisioningRoleArn() == null) ? 0 : getProvisioningRoleArn().hashCode()); hashCode = prime * hashCode + ((getPreProvisioningHook() == null) ? 0 : getPreProvisioningHook().hashCode()); hashCode = prime * hashCode + ((getRemovePreProvisioningHook() == null) ? 0 : getRemovePreProvisioningHook() .hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateProvisioningTemplateRequest == false) return false; UpdateProvisioningTemplateRequest other = (UpdateProvisioningTemplateRequest) obj; if (other.getTemplateName() == null ^ this.getTemplateName() == null) return false; if (other.getTemplateName() != null && other.getTemplateName().equals(this.getTemplateName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getEnabled() == null ^ this.getEnabled() == null) return false; if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false) return false; if (other.getDefaultVersionId() == null ^ this.getDefaultVersionId() == null) return false; if (other.getDefaultVersionId() != null && other.getDefaultVersionId().equals(this.getDefaultVersionId()) == false) return false; if (other.getProvisioningRoleArn() == null ^ this.getProvisioningRoleArn() == null) return false; if (other.getProvisioningRoleArn() != null && other.getProvisioningRoleArn().equals(this.getProvisioningRoleArn()) == false) return false; if (other.getPreProvisioningHook() == null ^ this.getPreProvisioningHook() == null) return false; if (other.getPreProvisioningHook() != null && other.getPreProvisioningHook().equals(this.getPreProvisioningHook()) == false) return false; if (other.getRemovePreProvisioningHook() == null ^ this.getRemovePreProvisioningHook() == null) return false; if (other.getRemovePreProvisioningHook() != null && other.getRemovePreProvisioningHook().equals(this.getRemovePreProvisioningHook()) == false) return false; return true; } }