com.amazonaws.services.ecr.model.RegistryScanningRule Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ecr Show documentation
/*
* 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.ecr.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The details of a scanning rule for a private registry.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RegistryScanningRule implements Serializable, Cloneable, StructuredPojo {
/**
*
* The frequency that scans are performed at for a private registry. When the ENHANCED
scan type is
* specified, the supported scan frequencies are CONTINUOUS_SCAN
and SCAN_ON_PUSH
. When
* the BASIC
scan type is specified, the SCAN_ON_PUSH
scan frequency is supported. If scan
* on push is not specified, then the MANUAL
scan frequency is set by default.
*
*/
private String scanFrequency;
/**
*
* The repository filters associated with the scanning configuration for a private registry.
*
*/
private java.util.List repositoryFilters;
/**
*
* The frequency that scans are performed at for a private registry. When the ENHANCED
scan type is
* specified, the supported scan frequencies are CONTINUOUS_SCAN
and SCAN_ON_PUSH
. When
* the BASIC
scan type is specified, the SCAN_ON_PUSH
scan frequency is supported. If scan
* on push is not specified, then the MANUAL
scan frequency is set by default.
*
*
* @param scanFrequency
* The frequency that scans are performed at for a private registry. When the ENHANCED
scan type
* is specified, the supported scan frequencies are CONTINUOUS_SCAN
and
* SCAN_ON_PUSH
. When the BASIC
scan type is specified, the
* SCAN_ON_PUSH
scan frequency is supported. If scan on push is not specified, then the
* MANUAL
scan frequency is set by default.
* @see ScanFrequency
*/
public void setScanFrequency(String scanFrequency) {
this.scanFrequency = scanFrequency;
}
/**
*
* The frequency that scans are performed at for a private registry. When the ENHANCED
scan type is
* specified, the supported scan frequencies are CONTINUOUS_SCAN
and SCAN_ON_PUSH
. When
* the BASIC
scan type is specified, the SCAN_ON_PUSH
scan frequency is supported. If scan
* on push is not specified, then the MANUAL
scan frequency is set by default.
*
*
* @return The frequency that scans are performed at for a private registry. When the ENHANCED
scan
* type is specified, the supported scan frequencies are CONTINUOUS_SCAN
and
* SCAN_ON_PUSH
. When the BASIC
scan type is specified, the
* SCAN_ON_PUSH
scan frequency is supported. If scan on push is not specified, then the
* MANUAL
scan frequency is set by default.
* @see ScanFrequency
*/
public String getScanFrequency() {
return this.scanFrequency;
}
/**
*
* The frequency that scans are performed at for a private registry. When the ENHANCED
scan type is
* specified, the supported scan frequencies are CONTINUOUS_SCAN
and SCAN_ON_PUSH
. When
* the BASIC
scan type is specified, the SCAN_ON_PUSH
scan frequency is supported. If scan
* on push is not specified, then the MANUAL
scan frequency is set by default.
*
*
* @param scanFrequency
* The frequency that scans are performed at for a private registry. When the ENHANCED
scan type
* is specified, the supported scan frequencies are CONTINUOUS_SCAN
and
* SCAN_ON_PUSH
. When the BASIC
scan type is specified, the
* SCAN_ON_PUSH
scan frequency is supported. If scan on push is not specified, then the
* MANUAL
scan frequency is set by default.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ScanFrequency
*/
public RegistryScanningRule withScanFrequency(String scanFrequency) {
setScanFrequency(scanFrequency);
return this;
}
/**
*
* The frequency that scans are performed at for a private registry. When the ENHANCED
scan type is
* specified, the supported scan frequencies are CONTINUOUS_SCAN
and SCAN_ON_PUSH
. When
* the BASIC
scan type is specified, the SCAN_ON_PUSH
scan frequency is supported. If scan
* on push is not specified, then the MANUAL
scan frequency is set by default.
*
*
* @param scanFrequency
* The frequency that scans are performed at for a private registry. When the ENHANCED
scan type
* is specified, the supported scan frequencies are CONTINUOUS_SCAN
and
* SCAN_ON_PUSH
. When the BASIC
scan type is specified, the
* SCAN_ON_PUSH
scan frequency is supported. If scan on push is not specified, then the
* MANUAL
scan frequency is set by default.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ScanFrequency
*/
public RegistryScanningRule withScanFrequency(ScanFrequency scanFrequency) {
this.scanFrequency = scanFrequency.toString();
return this;
}
/**
*
* The repository filters associated with the scanning configuration for a private registry.
*
*
* @return The repository filters associated with the scanning configuration for a private registry.
*/
public java.util.List getRepositoryFilters() {
return repositoryFilters;
}
/**
*
* The repository filters associated with the scanning configuration for a private registry.
*
*
* @param repositoryFilters
* The repository filters associated with the scanning configuration for a private registry.
*/
public void setRepositoryFilters(java.util.Collection repositoryFilters) {
if (repositoryFilters == null) {
this.repositoryFilters = null;
return;
}
this.repositoryFilters = new java.util.ArrayList(repositoryFilters);
}
/**
*
* The repository filters associated with the scanning configuration for a private registry.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRepositoryFilters(java.util.Collection)} or {@link #withRepositoryFilters(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param repositoryFilters
* The repository filters associated with the scanning configuration for a private registry.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegistryScanningRule withRepositoryFilters(ScanningRepositoryFilter... repositoryFilters) {
if (this.repositoryFilters == null) {
setRepositoryFilters(new java.util.ArrayList(repositoryFilters.length));
}
for (ScanningRepositoryFilter ele : repositoryFilters) {
this.repositoryFilters.add(ele);
}
return this;
}
/**
*
* The repository filters associated with the scanning configuration for a private registry.
*
*
* @param repositoryFilters
* The repository filters associated with the scanning configuration for a private registry.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RegistryScanningRule withRepositoryFilters(java.util.Collection repositoryFilters) {
setRepositoryFilters(repositoryFilters);
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 (getScanFrequency() != null)
sb.append("ScanFrequency: ").append(getScanFrequency()).append(",");
if (getRepositoryFilters() != null)
sb.append("RepositoryFilters: ").append(getRepositoryFilters());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RegistryScanningRule == false)
return false;
RegistryScanningRule other = (RegistryScanningRule) obj;
if (other.getScanFrequency() == null ^ this.getScanFrequency() == null)
return false;
if (other.getScanFrequency() != null && other.getScanFrequency().equals(this.getScanFrequency()) == false)
return false;
if (other.getRepositoryFilters() == null ^ this.getRepositoryFilters() == null)
return false;
if (other.getRepositoryFilters() != null && other.getRepositoryFilters().equals(this.getRepositoryFilters()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getScanFrequency() == null) ? 0 : getScanFrequency().hashCode());
hashCode = prime * hashCode + ((getRepositoryFilters() == null) ? 0 : getRepositoryFilters().hashCode());
return hashCode;
}
@Override
public RegistryScanningRule clone() {
try {
return (RegistryScanningRule) 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.ecr.model.transform.RegistryScanningRuleMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}