software.amazon.awssdk.services.directconnect.model.UpdateLagRequest 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.directconnect.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 UpdateLagRequest extends DirectConnectRequest implements
ToCopyableBuilder {
private static final SdkField LAG_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("lagId")
.getter(getter(UpdateLagRequest::lagId)).setter(setter(Builder::lagId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lagId").build()).build();
private static final SdkField LAG_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("lagName").getter(getter(UpdateLagRequest::lagName)).setter(setter(Builder::lagName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lagName").build()).build();
private static final SdkField MINIMUM_LINKS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("minimumLinks").getter(getter(UpdateLagRequest::minimumLinks)).setter(setter(Builder::minimumLinks))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("minimumLinks").build()).build();
private static final SdkField ENCRYPTION_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("encryptionMode").getter(getter(UpdateLagRequest::encryptionMode))
.setter(setter(Builder::encryptionMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encryptionMode").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LAG_ID_FIELD, LAG_NAME_FIELD,
MINIMUM_LINKS_FIELD, ENCRYPTION_MODE_FIELD));
private final String lagId;
private final String lagName;
private final Integer minimumLinks;
private final String encryptionMode;
private UpdateLagRequest(BuilderImpl builder) {
super(builder);
this.lagId = builder.lagId;
this.lagName = builder.lagName;
this.minimumLinks = builder.minimumLinks;
this.encryptionMode = builder.encryptionMode;
}
/**
*
* The ID of the LAG.
*
*
* @return The ID of the LAG.
*/
public final String lagId() {
return lagId;
}
/**
*
* The name of the LAG.
*
*
* @return The name of the LAG.
*/
public final String lagName() {
return lagName;
}
/**
*
* The minimum number of physical connections that must be operational for the LAG itself to be operational.
*
*
* @return The minimum number of physical connections that must be operational for the LAG itself to be operational.
*/
public final Integer minimumLinks() {
return minimumLinks;
}
/**
*
* The LAG MAC Security (MACsec) encryption mode.
*
*
* AWS applies the value to all connections which are part of the LAG.
*
*
* @return The LAG MAC Security (MACsec) encryption mode.
*
* AWS applies the value to all connections which are part of the LAG.
*/
public final String encryptionMode() {
return encryptionMode;
}
@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(lagId());
hashCode = 31 * hashCode + Objects.hashCode(lagName());
hashCode = 31 * hashCode + Objects.hashCode(minimumLinks());
hashCode = 31 * hashCode + Objects.hashCode(encryptionMode());
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 UpdateLagRequest)) {
return false;
}
UpdateLagRequest other = (UpdateLagRequest) obj;
return Objects.equals(lagId(), other.lagId()) && Objects.equals(lagName(), other.lagName())
&& Objects.equals(minimumLinks(), other.minimumLinks())
&& Objects.equals(encryptionMode(), other.encryptionMode());
}
/**
* 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("UpdateLagRequest").add("LagId", lagId()).add("LagName", lagName())
.add("MinimumLinks", minimumLinks()).add("EncryptionMode", encryptionMode()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "lagId":
return Optional.ofNullable(clazz.cast(lagId()));
case "lagName":
return Optional.ofNullable(clazz.cast(lagName()));
case "minimumLinks":
return Optional.ofNullable(clazz.cast(minimumLinks()));
case "encryptionMode":
return Optional.ofNullable(clazz.cast(encryptionMode()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* AWS applies the value to all connections which are part of the LAG.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder encryptionMode(String encryptionMode);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends DirectConnectRequest.BuilderImpl implements Builder {
private String lagId;
private String lagName;
private Integer minimumLinks;
private String encryptionMode;
private BuilderImpl() {
}
private BuilderImpl(UpdateLagRequest model) {
super(model);
lagId(model.lagId);
lagName(model.lagName);
minimumLinks(model.minimumLinks);
encryptionMode(model.encryptionMode);
}
public final String getLagId() {
return lagId;
}
@Override
public final Builder lagId(String lagId) {
this.lagId = lagId;
return this;
}
public final void setLagId(String lagId) {
this.lagId = lagId;
}
public final String getLagName() {
return lagName;
}
@Override
public final Builder lagName(String lagName) {
this.lagName = lagName;
return this;
}
public final void setLagName(String lagName) {
this.lagName = lagName;
}
public final Integer getMinimumLinks() {
return minimumLinks;
}
@Override
public final Builder minimumLinks(Integer minimumLinks) {
this.minimumLinks = minimumLinks;
return this;
}
public final void setMinimumLinks(Integer minimumLinks) {
this.minimumLinks = minimumLinks;
}
public final String getEncryptionMode() {
return encryptionMode;
}
@Override
public final Builder encryptionMode(String encryptionMode) {
this.encryptionMode = encryptionMode;
return this;
}
public final void setEncryptionMode(String encryptionMode) {
this.encryptionMode = encryptionMode;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public UpdateLagRequest build() {
return new UpdateLagRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}