software.amazon.awssdk.services.sagemaker.model.UpdateDeviceFleetRequest Maven / Gradle / Ivy
Show all versions of sagemaker 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.sagemaker.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 UpdateDeviceFleetRequest extends SageMakerRequest implements
ToCopyableBuilder {
private static final SdkField DEVICE_FLEET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeviceFleetName").getter(getter(UpdateDeviceFleetRequest::deviceFleetName))
.setter(setter(Builder::deviceFleetName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceFleetName").build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleArn").getter(getter(UpdateDeviceFleetRequest::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(UpdateDeviceFleetRequest::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField OUTPUT_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("OutputConfig")
.getter(getter(UpdateDeviceFleetRequest::outputConfig)).setter(setter(Builder::outputConfig))
.constructor(EdgeOutputConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputConfig").build()).build();
private static final SdkField ENABLE_IOT_ROLE_ALIAS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("EnableIotRoleAlias").getter(getter(UpdateDeviceFleetRequest::enableIotRoleAlias))
.setter(setter(Builder::enableIotRoleAlias))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnableIotRoleAlias").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DEVICE_FLEET_NAME_FIELD,
ROLE_ARN_FIELD, DESCRIPTION_FIELD, OUTPUT_CONFIG_FIELD, ENABLE_IOT_ROLE_ALIAS_FIELD));
private final String deviceFleetName;
private final String roleArn;
private final String description;
private final EdgeOutputConfig outputConfig;
private final Boolean enableIotRoleAlias;
private UpdateDeviceFleetRequest(BuilderImpl builder) {
super(builder);
this.deviceFleetName = builder.deviceFleetName;
this.roleArn = builder.roleArn;
this.description = builder.description;
this.outputConfig = builder.outputConfig;
this.enableIotRoleAlias = builder.enableIotRoleAlias;
}
/**
*
* The name of the fleet.
*
*
* @return The name of the fleet.
*/
public final String deviceFleetName() {
return deviceFleetName;
}
/**
*
* The Amazon Resource Name (ARN) of the device.
*
*
* @return The Amazon Resource Name (ARN) of the device.
*/
public final String roleArn() {
return roleArn;
}
/**
*
* Description of the fleet.
*
*
* @return Description of the fleet.
*/
public final String description() {
return description;
}
/**
*
* Output configuration for storing sample data collected by the fleet.
*
*
* @return Output configuration for storing sample data collected by the fleet.
*/
public final EdgeOutputConfig outputConfig() {
return outputConfig;
}
/**
*
* Whether to create an Amazon Web Services IoT Role Alias during device fleet creation. The name of the role alias
* generated will match this pattern: "SageMakerEdge-{DeviceFleetName}".
*
*
* For example, if your device fleet is called "demo-fleet", the name of the role alias will be
* "SageMakerEdge-demo-fleet".
*
*
* @return Whether to create an Amazon Web Services IoT Role Alias during device fleet creation. The name of the
* role alias generated will match this pattern: "SageMakerEdge-{DeviceFleetName}".
*
* For example, if your device fleet is called "demo-fleet", the name of the role alias will be
* "SageMakerEdge-demo-fleet".
*/
public final Boolean enableIotRoleAlias() {
return enableIotRoleAlias;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(deviceFleetName());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(outputConfig());
hashCode = 31 * hashCode + Objects.hashCode(enableIotRoleAlias());
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 UpdateDeviceFleetRequest)) {
return false;
}
UpdateDeviceFleetRequest other = (UpdateDeviceFleetRequest) obj;
return Objects.equals(deviceFleetName(), other.deviceFleetName()) && Objects.equals(roleArn(), other.roleArn())
&& Objects.equals(description(), other.description()) && Objects.equals(outputConfig(), other.outputConfig())
&& Objects.equals(enableIotRoleAlias(), other.enableIotRoleAlias());
}
/**
* 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("UpdateDeviceFleetRequest").add("DeviceFleetName", deviceFleetName()).add("RoleArn", roleArn())
.add("Description", description()).add("OutputConfig", outputConfig())
.add("EnableIotRoleAlias", enableIotRoleAlias()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DeviceFleetName":
return Optional.ofNullable(clazz.cast(deviceFleetName()));
case "RoleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "OutputConfig":
return Optional.ofNullable(clazz.cast(outputConfig()));
case "EnableIotRoleAlias":
return Optional.ofNullable(clazz.cast(enableIotRoleAlias()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function