@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPrincipal() == null) ? 0 : getPrincipal().hashCode()); return hashCode; }
/** * <p> * The policy name. * </p> * * @param policyName * The policy name. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachPrincipalPolicyRequest withPolicyName(String policyName) { setPolicyName(policyName); return this; }
/** * <p> * The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an Amazon * Cognito ID. * </p> * * @param principal * The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an * Amazon Cognito ID. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachPrincipalPolicyRequest withPrincipal(String principal) { setPrincipal(principal); return this; }
AttachPrincipalPolicyRequest policyRequest = new AttachPrincipalPolicyRequest(); policyRequest.setPolicyName(createPolicyResult.getPolicyName()); policyRequest.setPrincipal(certResult.getCertificateArn()); iotClient.attachPrincipalPolicy(policyRequest);
AttachPrincipalPolicyRequest policyRequest = new AttachPrincipalPolicyRequest(); policyRequest.setPolicyName(createPolicyResult.getPolicyName()); policyRequest.setPrincipal(certResult.getCertificateArn()); iotClient.attachPrincipalPolicy(policyRequest);
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachPrincipalPolicyRequest == false) return false; AttachPrincipalPolicyRequest other = (AttachPrincipalPolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getPrincipal() == null ^ this.getPrincipal() == null) return false; if (other.getPrincipal() != null && other.getPrincipal().equals(this.getPrincipal()) == false) return false; return true; }
AttachPrincipalPolicyRequest policyRequest = new AttachPrincipalPolicyRequest(); policyRequest.setPolicyName(createPolicyResult.getPolicyName()); policyRequest.setPrincipal(certResult.getCertificateArn()); iotClient.attachPrincipalPolicy(policyRequest);
/** * <p> * The policy name. * </p> * * @param policyName * The policy name. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachPrincipalPolicyRequest withPolicyName(String policyName) { setPolicyName(policyName); return this; }
/** * <p> * The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an Amazon * Cognito ID. * </p> * * @param principal * The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an * Amazon Cognito ID. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachPrincipalPolicyRequest withPrincipal(String principal) { setPrincipal(principal); 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 (getPolicyName() != null) sb.append("PolicyName: ").append(getPolicyName()).append(","); if (getPrincipal() != null) sb.append("Principal: ").append(getPrincipal()); sb.append("}"); return sb.toString(); }
AttachPrincipalPolicyRequest policyRequest = new AttachPrincipalPolicyRequest(); policyRequest.setPolicyName(createPolicyResult.getPolicyName()); policyRequest.setPrincipal(certResult.getCertificateArn()); iotClient.attachPrincipalPolicy(policyRequest);
/** * Marshall the given parameter object. */ public void marshall(AttachPrincipalPolicyRequest attachPrincipalPolicyRequest, ProtocolMarshaller protocolMarshaller) { if (attachPrincipalPolicyRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(attachPrincipalPolicyRequest.getPolicyName(), POLICYNAME_BINDING); protocolMarshaller.marshall(attachPrincipalPolicyRequest.getPrincipal(), PRINCIPAL_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
AttachPrincipalPolicyRequest policyRequest = new AttachPrincipalPolicyRequest(); policyRequest.setPolicyName(createPolicyResult.getPolicyName()); policyRequest.setPrincipal(certResult.getCertificateArn()); iotClient.attachPrincipalPolicy(policyRequest);
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPrincipal() == null) ? 0 : getPrincipal().hashCode()); return hashCode; }
new AttachPrincipalPolicyRequest(); policyAttachRequest.setPolicyName(AWS_IOT_POLICY_NAME); policyAttachRequest.setPrincipal(createKeysAndCertificateResult .getCertificateArn()); mIotAndroidClient.attachPrincipalPolicy(policyAttachRequest);
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachPrincipalPolicyRequest == false) return false; AttachPrincipalPolicyRequest other = (AttachPrincipalPolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getPrincipal() == null ^ this.getPrincipal() == null) return false; if (other.getPrincipal() != null && other.getPrincipal().equals(this.getPrincipal()) == false) return false; return true; } }
/** * 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 (getPolicyName() != null) sb.append("policyName: " + getPolicyName() + ","); if (getPrincipal() != null) sb.append("principal: " + getPrincipal()); sb.append("}"); return sb.toString(); }
public Request<AttachPrincipalPolicyRequest> marshall( AttachPrincipalPolicyRequest attachPrincipalPolicyRequest) { if (attachPrincipalPolicyRequest == null) { throw new AmazonClientException( "Invalid argument passed to marshall(AttachPrincipalPolicyRequest)"); } Request<AttachPrincipalPolicyRequest> request = new DefaultRequest<AttachPrincipalPolicyRequest>( attachPrincipalPolicyRequest, "AWSIot"); request.setHttpMethod(HttpMethodName.PUT); if (attachPrincipalPolicyRequest.getPrincipal() != null) { request.addHeader("x-amzn-iot-principal", StringUtils.fromString(attachPrincipalPolicyRequest.getPrincipal())); } String uriResourcePath = "/principal-policies/{policyName}"; uriResourcePath = uriResourcePath.replace( "{policyName}", (attachPrincipalPolicyRequest.getPolicyName() == null) ? "" : StringUtils .fromString(attachPrincipalPolicyRequest.getPolicyName())); request.setResourcePath(uriResourcePath); request.addHeader("Content-Length", "0"); request.setContent(new ByteArrayInputStream(new byte[0])); if (!request.getHeaders().containsKey("Content-Type")) { request.addHeader("Content-Type", "application/x-amz-json-1.0"); } return request; } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPrincipal() == null) ? 0 : getPrincipal().hashCode()); return hashCode; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPrincipal() == null) ? 0 : getPrincipal().hashCode()); return hashCode; }