software.amazon.awssdk.services.devicefarm.model.UpdateNetworkProfileRequest Maven / Gradle / Ivy
Show all versions of devicefarm Show documentation
/*
* 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.devicefarm.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 UpdateNetworkProfileRequest extends DeviceFarmRequest implements
ToCopyableBuilder {
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn")
.getter(getter(UpdateNetworkProfileRequest::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(UpdateNetworkProfileRequest::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(UpdateNetworkProfileRequest::description))
.setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("type")
.getter(getter(UpdateNetworkProfileRequest::typeAsString)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build();
private static final SdkField UPLINK_BANDWIDTH_BITS_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("uplinkBandwidthBits").getter(getter(UpdateNetworkProfileRequest::uplinkBandwidthBits))
.setter(setter(Builder::uplinkBandwidthBits))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("uplinkBandwidthBits").build())
.build();
private static final SdkField DOWNLINK_BANDWIDTH_BITS_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("downlinkBandwidthBits").getter(getter(UpdateNetworkProfileRequest::downlinkBandwidthBits))
.setter(setter(Builder::downlinkBandwidthBits))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("downlinkBandwidthBits").build())
.build();
private static final SdkField UPLINK_DELAY_MS_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("uplinkDelayMs").getter(getter(UpdateNetworkProfileRequest::uplinkDelayMs))
.setter(setter(Builder::uplinkDelayMs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("uplinkDelayMs").build()).build();
private static final SdkField DOWNLINK_DELAY_MS_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("downlinkDelayMs").getter(getter(UpdateNetworkProfileRequest::downlinkDelayMs))
.setter(setter(Builder::downlinkDelayMs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("downlinkDelayMs").build()).build();
private static final SdkField UPLINK_JITTER_MS_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("uplinkJitterMs").getter(getter(UpdateNetworkProfileRequest::uplinkJitterMs))
.setter(setter(Builder::uplinkJitterMs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("uplinkJitterMs").build()).build();
private static final SdkField DOWNLINK_JITTER_MS_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("downlinkJitterMs").getter(getter(UpdateNetworkProfileRequest::downlinkJitterMs))
.setter(setter(Builder::downlinkJitterMs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("downlinkJitterMs").build()).build();
private static final SdkField UPLINK_LOSS_PERCENT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("uplinkLossPercent").getter(getter(UpdateNetworkProfileRequest::uplinkLossPercent))
.setter(setter(Builder::uplinkLossPercent))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("uplinkLossPercent").build()).build();
private static final SdkField DOWNLINK_LOSS_PERCENT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("downlinkLossPercent").getter(getter(UpdateNetworkProfileRequest::downlinkLossPercent))
.setter(setter(Builder::downlinkLossPercent))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("downlinkLossPercent").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, NAME_FIELD,
DESCRIPTION_FIELD, TYPE_FIELD, UPLINK_BANDWIDTH_BITS_FIELD, DOWNLINK_BANDWIDTH_BITS_FIELD, UPLINK_DELAY_MS_FIELD,
DOWNLINK_DELAY_MS_FIELD, UPLINK_JITTER_MS_FIELD, DOWNLINK_JITTER_MS_FIELD, UPLINK_LOSS_PERCENT_FIELD,
DOWNLINK_LOSS_PERCENT_FIELD));
private final String arn;
private final String name;
private final String description;
private final String type;
private final Long uplinkBandwidthBits;
private final Long downlinkBandwidthBits;
private final Long uplinkDelayMs;
private final Long downlinkDelayMs;
private final Long uplinkJitterMs;
private final Long downlinkJitterMs;
private final Integer uplinkLossPercent;
private final Integer downlinkLossPercent;
private UpdateNetworkProfileRequest(BuilderImpl builder) {
super(builder);
this.arn = builder.arn;
this.name = builder.name;
this.description = builder.description;
this.type = builder.type;
this.uplinkBandwidthBits = builder.uplinkBandwidthBits;
this.downlinkBandwidthBits = builder.downlinkBandwidthBits;
this.uplinkDelayMs = builder.uplinkDelayMs;
this.downlinkDelayMs = builder.downlinkDelayMs;
this.uplinkJitterMs = builder.uplinkJitterMs;
this.downlinkJitterMs = builder.downlinkJitterMs;
this.uplinkLossPercent = builder.uplinkLossPercent;
this.downlinkLossPercent = builder.downlinkLossPercent;
}
/**
*
* The Amazon Resource Name (ARN) of the project for which you want to update network profile settings.
*
*
* @return The Amazon Resource Name (ARN) of the project for which you want to update network profile settings.
*/
public final String arn() {
return arn;
}
/**
*
* The name of the network profile about which you are returning information.
*
*
* @return The name of the network profile about which you are returning information.
*/
public final String name() {
return name;
}
/**
*
* The description of the network profile about which you are returning information.
*
*
* @return The description of the network profile about which you are returning information.
*/
public final String description() {
return description;
}
/**
*
* The type of network profile to return information about. Valid values are listed here.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link NetworkProfileType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The type of network profile to return information about. Valid values are listed here.
* @see NetworkProfileType
*/
public final NetworkProfileType type() {
return NetworkProfileType.fromValue(type);
}
/**
*
* The type of network profile to return information about. Valid values are listed here.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link NetworkProfileType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The type of network profile to return information about. Valid values are listed here.
* @see NetworkProfileType
*/
public final String typeAsString() {
return type;
}
/**
*
* The data throughput rate in bits per second, as an integer from 0 to 104857600.
*
*
* @return The data throughput rate in bits per second, as an integer from 0 to 104857600.
*/
public final Long uplinkBandwidthBits() {
return uplinkBandwidthBits;
}
/**
*
* The data throughput rate in bits per second, as an integer from 0 to 104857600.
*
*
* @return The data throughput rate in bits per second, as an integer from 0 to 104857600.
*/
public final Long downlinkBandwidthBits() {
return downlinkBandwidthBits;
}
/**
*
* Delay time for all packets to destination in milliseconds as an integer from 0 to 2000.
*
*
* @return Delay time for all packets to destination in milliseconds as an integer from 0 to 2000.
*/
public final Long uplinkDelayMs() {
return uplinkDelayMs;
}
/**
*
* Delay time for all packets to destination in milliseconds as an integer from 0 to 2000.
*
*
* @return Delay time for all packets to destination in milliseconds as an integer from 0 to 2000.
*/
public final Long downlinkDelayMs() {
return downlinkDelayMs;
}
/**
*
* Time variation in the delay of received packets in milliseconds as an integer from 0 to 2000.
*
*
* @return Time variation in the delay of received packets in milliseconds as an integer from 0 to 2000.
*/
public final Long uplinkJitterMs() {
return uplinkJitterMs;
}
/**
*
* Time variation in the delay of received packets in milliseconds as an integer from 0 to 2000.
*
*
* @return Time variation in the delay of received packets in milliseconds as an integer from 0 to 2000.
*/
public final Long downlinkJitterMs() {
return downlinkJitterMs;
}
/**
*
* Proportion of transmitted packets that fail to arrive from 0 to 100 percent.
*
*
* @return Proportion of transmitted packets that fail to arrive from 0 to 100 percent.
*/
public final Integer uplinkLossPercent() {
return uplinkLossPercent;
}
/**
*
* Proportion of received packets that fail to arrive from 0 to 100 percent.
*
*
* @return Proportion of received packets that fail to arrive from 0 to 100 percent.
*/
public final Integer downlinkLossPercent() {
return downlinkLossPercent;
}
@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(arn());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(typeAsString());
hashCode = 31 * hashCode + Objects.hashCode(uplinkBandwidthBits());
hashCode = 31 * hashCode + Objects.hashCode(downlinkBandwidthBits());
hashCode = 31 * hashCode + Objects.hashCode(uplinkDelayMs());
hashCode = 31 * hashCode + Objects.hashCode(downlinkDelayMs());
hashCode = 31 * hashCode + Objects.hashCode(uplinkJitterMs());
hashCode = 31 * hashCode + Objects.hashCode(downlinkJitterMs());
hashCode = 31 * hashCode + Objects.hashCode(uplinkLossPercent());
hashCode = 31 * hashCode + Objects.hashCode(downlinkLossPercent());
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 UpdateNetworkProfileRequest)) {
return false;
}
UpdateNetworkProfileRequest other = (UpdateNetworkProfileRequest) obj;
return Objects.equals(arn(), other.arn()) && Objects.equals(name(), other.name())
&& Objects.equals(description(), other.description()) && Objects.equals(typeAsString(), other.typeAsString())
&& Objects.equals(uplinkBandwidthBits(), other.uplinkBandwidthBits())
&& Objects.equals(downlinkBandwidthBits(), other.downlinkBandwidthBits())
&& Objects.equals(uplinkDelayMs(), other.uplinkDelayMs())
&& Objects.equals(downlinkDelayMs(), other.downlinkDelayMs())
&& Objects.equals(uplinkJitterMs(), other.uplinkJitterMs())
&& Objects.equals(downlinkJitterMs(), other.downlinkJitterMs())
&& Objects.equals(uplinkLossPercent(), other.uplinkLossPercent())
&& Objects.equals(downlinkLossPercent(), other.downlinkLossPercent());
}
/**
* 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("UpdateNetworkProfileRequest").add("Arn", arn()).add("Name", name())
.add("Description", description()).add("Type", typeAsString()).add("UplinkBandwidthBits", uplinkBandwidthBits())
.add("DownlinkBandwidthBits", downlinkBandwidthBits()).add("UplinkDelayMs", uplinkDelayMs())
.add("DownlinkDelayMs", downlinkDelayMs()).add("UplinkJitterMs", uplinkJitterMs())
.add("DownlinkJitterMs", downlinkJitterMs()).add("UplinkLossPercent", uplinkLossPercent())
.add("DownlinkLossPercent", downlinkLossPercent()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "arn":
return Optional.ofNullable(clazz.cast(arn()));
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "type":
return Optional.ofNullable(clazz.cast(typeAsString()));
case "uplinkBandwidthBits":
return Optional.ofNullable(clazz.cast(uplinkBandwidthBits()));
case "downlinkBandwidthBits":
return Optional.ofNullable(clazz.cast(downlinkBandwidthBits()));
case "uplinkDelayMs":
return Optional.ofNullable(clazz.cast(uplinkDelayMs()));
case "downlinkDelayMs":
return Optional.ofNullable(clazz.cast(downlinkDelayMs()));
case "uplinkJitterMs":
return Optional.ofNullable(clazz.cast(uplinkJitterMs()));
case "downlinkJitterMs":
return Optional.ofNullable(clazz.cast(downlinkJitterMs()));
case "uplinkLossPercent":
return Optional.ofNullable(clazz.cast(uplinkLossPercent()));
case "downlinkLossPercent":
return Optional.ofNullable(clazz.cast(downlinkLossPercent()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function