com.amazonaws.services.osis.model.LogPublishingOptions Maven / Gradle / Ivy
Show all versions of aws-java-sdk-osis Show documentation
/*
* Copyright 2019-2024 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.osis.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Container for the values required to configure logging for the pipeline. If you don't specify these values,
* OpenSearch Ingestion will not publish logs from your application to CloudWatch Logs.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class LogPublishingOptions implements Serializable, Cloneable, StructuredPojo {
/**
*
* Whether logs should be published.
*
*/
private Boolean isLoggingEnabled;
/**
*
* The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch Logs. This parameter is required if
* IsLoggingEnabled
is set to true
.
*
*/
private CloudWatchLogDestination cloudWatchLogDestination;
/**
*
* Whether logs should be published.
*
*
* @param isLoggingEnabled
* Whether logs should be published.
*/
public void setIsLoggingEnabled(Boolean isLoggingEnabled) {
this.isLoggingEnabled = isLoggingEnabled;
}
/**
*
* Whether logs should be published.
*
*
* @return Whether logs should be published.
*/
public Boolean getIsLoggingEnabled() {
return this.isLoggingEnabled;
}
/**
*
* Whether logs should be published.
*
*
* @param isLoggingEnabled
* Whether logs should be published.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LogPublishingOptions withIsLoggingEnabled(Boolean isLoggingEnabled) {
setIsLoggingEnabled(isLoggingEnabled);
return this;
}
/**
*
* Whether logs should be published.
*
*
* @return Whether logs should be published.
*/
public Boolean isLoggingEnabled() {
return this.isLoggingEnabled;
}
/**
*
* The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch Logs. This parameter is required if
* IsLoggingEnabled
is set to true
.
*
*
* @param cloudWatchLogDestination
* The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch Logs. This parameter is required
* if IsLoggingEnabled
is set to true
.
*/
public void setCloudWatchLogDestination(CloudWatchLogDestination cloudWatchLogDestination) {
this.cloudWatchLogDestination = cloudWatchLogDestination;
}
/**
*
* The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch Logs. This parameter is required if
* IsLoggingEnabled
is set to true
.
*
*
* @return The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch Logs. This parameter is required
* if IsLoggingEnabled
is set to true
.
*/
public CloudWatchLogDestination getCloudWatchLogDestination() {
return this.cloudWatchLogDestination;
}
/**
*
* The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch Logs. This parameter is required if
* IsLoggingEnabled
is set to true
.
*
*
* @param cloudWatchLogDestination
* The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch Logs. This parameter is required
* if IsLoggingEnabled
is set to true
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LogPublishingOptions withCloudWatchLogDestination(CloudWatchLogDestination cloudWatchLogDestination) {
setCloudWatchLogDestination(cloudWatchLogDestination);
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 (getIsLoggingEnabled() != null)
sb.append("IsLoggingEnabled: ").append(getIsLoggingEnabled()).append(",");
if (getCloudWatchLogDestination() != null)
sb.append("CloudWatchLogDestination: ").append(getCloudWatchLogDestination());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof LogPublishingOptions == false)
return false;
LogPublishingOptions other = (LogPublishingOptions) obj;
if (other.getIsLoggingEnabled() == null ^ this.getIsLoggingEnabled() == null)
return false;
if (other.getIsLoggingEnabled() != null && other.getIsLoggingEnabled().equals(this.getIsLoggingEnabled()) == false)
return false;
if (other.getCloudWatchLogDestination() == null ^ this.getCloudWatchLogDestination() == null)
return false;
if (other.getCloudWatchLogDestination() != null && other.getCloudWatchLogDestination().equals(this.getCloudWatchLogDestination()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getIsLoggingEnabled() == null) ? 0 : getIsLoggingEnabled().hashCode());
hashCode = prime * hashCode + ((getCloudWatchLogDestination() == null) ? 0 : getCloudWatchLogDestination().hashCode());
return hashCode;
}
@Override
public LogPublishingOptions clone() {
try {
return (LogPublishingOptions) 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.osis.model.transform.LogPublishingOptionsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}