/* * 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; /** *

* For more information, see Signature Version 4 signing process. *

*/ public class SigV4Authorization implements Serializable { /** *

* The signing region. *

*/ private String signingRegion; /** *

* The service name to use while signing with Sig V4. *

*/ private String serviceName; /** *

* The ARN of the signing role. *

*/ private String roleArn; /** *

* The signing region. *

* * @return

* The signing region. *

*/ public String getSigningRegion() { return signingRegion; } /** *

* The signing region. *

* * @param signingRegion

* The signing region. *

*/ public void setSigningRegion(String signingRegion) { this.signingRegion = signingRegion; } /** *

* The signing region. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param signingRegion

* The signing region. *

* @return A reference to this updated object so that method calls can be * chained together. */ public SigV4Authorization withSigningRegion(String signingRegion) { this.signingRegion = signingRegion; return this; } /** *

* The service name to use while signing with Sig V4. *

* * @return

* The service name to use while signing with Sig V4. *

*/ public String getServiceName() { return serviceName; } /** *

* The service name to use while signing with Sig V4. *

* * @param serviceName

* The service name to use while signing with Sig V4. *

*/ public void setServiceName(String serviceName) { this.serviceName = serviceName; } /** *

* The service name to use while signing with Sig V4. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param serviceName

* The service name to use while signing with Sig V4. *

* @return A reference to this updated object so that method calls can be * chained together. */ public SigV4Authorization withServiceName(String serviceName) { this.serviceName = serviceName; return this; } /** *

* The ARN of the signing role. *

* * @return

* The ARN of the signing role. *

*/ public String getRoleArn() { return roleArn; } /** *

* The ARN of the signing role. *

* * @param roleArn

* The ARN of the signing role. *

*/ public void setRoleArn(String roleArn) { this.roleArn = roleArn; } /** *

* The ARN of the signing role. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param roleArn

* The ARN of the signing role. *

* @return A reference to this updated object so that method calls can be * chained together. */ public SigV4Authorization withRoleArn(String roleArn) { this.roleArn = roleArn; 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 (getSigningRegion() != null) sb.append("signingRegion: " + getSigningRegion() + ","); if (getServiceName() != null) sb.append("serviceName: " + getServiceName() + ","); if (getRoleArn() != null) sb.append("roleArn: " + getRoleArn()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSigningRegion() == null) ? 0 : getSigningRegion().hashCode()); hashCode = prime * hashCode + ((getServiceName() == null) ? 0 : getServiceName().hashCode()); hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SigV4Authorization == false) return false; SigV4Authorization other = (SigV4Authorization) obj; if (other.getSigningRegion() == null ^ this.getSigningRegion() == null) return false; if (other.getSigningRegion() != null && other.getSigningRegion().equals(this.getSigningRegion()) == 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.getRoleArn() == null ^ this.getRoleArn() == null) return false; if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false) return false; return true; } }