/* * 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.accessanalyzer.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* The proposed access control configuration for an Amazon ECR repository. You can propose a configuration for a new * Amazon ECR repository or an existing Amazon ECR repository that you own by specifying the Amazon ECR policy. For more * information, see Repository. *
** If the configuration is for an existing Amazon ECR repository and you do not specify the Amazon ECR policy, then the * access preview uses the existing Amazon ECR policy for the repository. *
** If the access preview is for a new resource and you do not specify the policy, then the access preview assumes an * Amazon ECR repository without a policy. *
** To propose deletion of an existing Amazon ECR repository policy, you can specify an empty string for the Amazon ECR * policy. *
** The JSON repository policy text to apply to the Amazon ECR repository. For more information, see Private repository * policy examples in the Amazon ECR User Guide. *
*/ private String repositoryPolicy; /** ** The JSON repository policy text to apply to the Amazon ECR repository. For more information, see Private repository * policy examples in the Amazon ECR User Guide. *
* * @param repositoryPolicy * The JSON repository policy text to apply to the Amazon ECR repository. For more information, see Private * repository policy examples in the Amazon ECR User Guide. */ public void setRepositoryPolicy(String repositoryPolicy) { this.repositoryPolicy = repositoryPolicy; } /** ** The JSON repository policy text to apply to the Amazon ECR repository. For more information, see Private repository * policy examples in the Amazon ECR User Guide. *
* * @return The JSON repository policy text to apply to the Amazon ECR repository. For more information, see Private * repository policy examples in the Amazon ECR User Guide. */ public String getRepositoryPolicy() { return this.repositoryPolicy; } /** ** The JSON repository policy text to apply to the Amazon ECR repository. For more information, see Private repository * policy examples in the Amazon ECR User Guide. *
* * @param repositoryPolicy * The JSON repository policy text to apply to the Amazon ECR repository. For more information, see Private * repository policy examples in the Amazon ECR User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public EcrRepositoryConfiguration withRepositoryPolicy(String repositoryPolicy) { setRepositoryPolicy(repositoryPolicy); 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 (getRepositoryPolicy() != null) sb.append("RepositoryPolicy: ").append(getRepositoryPolicy()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof EcrRepositoryConfiguration == false) return false; EcrRepositoryConfiguration other = (EcrRepositoryConfiguration) obj; if (other.getRepositoryPolicy() == null ^ this.getRepositoryPolicy() == null) return false; if (other.getRepositoryPolicy() != null && other.getRepositoryPolicy().equals(this.getRepositoryPolicy()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRepositoryPolicy() == null) ? 0 : getRepositoryPolicy().hashCode()); return hashCode; } @Override public EcrRepositoryConfiguration clone() { try { return (EcrRepositoryConfiguration) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.accessanalyzer.model.transform.EcrRepositoryConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller); } }