
software.amazon.awssdk.services.networkfirewall.model.DescribeLoggingConfigurationRequest Maven / Gradle / Ivy
/*
* Copyright 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 software.amazon.awssdk.services.networkfirewall.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DescribeLoggingConfigurationRequest extends NetworkFirewallRequest implements
ToCopyableBuilder {
private static final SdkField FIREWALL_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FirewallArn").getter(getter(DescribeLoggingConfigurationRequest::firewallArn))
.setter(setter(Builder::firewallArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FirewallArn").build()).build();
private static final SdkField FIREWALL_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FirewallName").getter(getter(DescribeLoggingConfigurationRequest::firewallName))
.setter(setter(Builder::firewallName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FirewallName").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FIREWALL_ARN_FIELD,
FIREWALL_NAME_FIELD));
private final String firewallArn;
private final String firewallName;
private DescribeLoggingConfigurationRequest(BuilderImpl builder) {
super(builder);
this.firewallArn = builder.firewallArn;
this.firewallName = builder.firewallName;
}
/**
*
* The Amazon Resource Name (ARN) of the firewall.
*
*
* You must specify the ARN or the name, and you can specify both.
*
*
* @return The Amazon Resource Name (ARN) of the firewall.
*
* You must specify the ARN or the name, and you can specify both.
*/
public final String firewallArn() {
return firewallArn;
}
/**
*
* The descriptive name of the firewall. You can't change the name of a firewall after you create it.
*
*
* You must specify the ARN or the name, and you can specify both.
*
*
* @return The descriptive name of the firewall. You can't change the name of a firewall after you create it.
*
* You must specify the ARN or the name, and you can specify both.
*/
public final String firewallName() {
return firewallName;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(firewallArn());
hashCode = 31 * hashCode + Objects.hashCode(firewallName());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DescribeLoggingConfigurationRequest)) {
return false;
}
DescribeLoggingConfigurationRequest other = (DescribeLoggingConfigurationRequest) obj;
return Objects.equals(firewallArn(), other.firewallArn()) && Objects.equals(firewallName(), other.firewallName());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("DescribeLoggingConfigurationRequest").add("FirewallArn", firewallArn())
.add("FirewallName", firewallName()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "FirewallArn":
return Optional.ofNullable(clazz.cast(firewallArn()));
case "FirewallName":
return Optional.ofNullable(clazz.cast(firewallName()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* You must specify the ARN or the name, and you can specify both.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder firewallArn(String firewallArn);
/**
*
* The descriptive name of the firewall. You can't change the name of a firewall after you create it.
*
*
* You must specify the ARN or the name, and you can specify both.
*
*
* @param firewallName
* The descriptive name of the firewall. You can't change the name of a firewall after you create it.
*
* You must specify the ARN or the name, and you can specify both.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder firewallName(String firewallName);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends NetworkFirewallRequest.BuilderImpl implements Builder {
private String firewallArn;
private String firewallName;
private BuilderImpl() {
}
private BuilderImpl(DescribeLoggingConfigurationRequest model) {
super(model);
firewallArn(model.firewallArn);
firewallName(model.firewallName);
}
public final String getFirewallArn() {
return firewallArn;
}
public final void setFirewallArn(String firewallArn) {
this.firewallArn = firewallArn;
}
@Override
public final Builder firewallArn(String firewallArn) {
this.firewallArn = firewallArn;
return this;
}
public final String getFirewallName() {
return firewallName;
}
public final void setFirewallName(String firewallName) {
this.firewallName = firewallName;
}
@Override
public final Builder firewallName(String firewallName) {
this.firewallName = firewallName;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public DescribeLoggingConfigurationRequest build() {
return new DescribeLoggingConfigurationRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}