All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.sagemaker.model.UpdateDeviceFleetRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon SageMaker module holds the client classes that are used for communicating with Amazon SageMaker Service

There is a newer version: 2.28.4
Show newest version
/*
 * 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 getter(Function g) { return obj -> g.apply((UpdateDeviceFleetRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SageMakerRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the fleet. *

* * @param deviceFleetName * The name of the fleet. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceFleetName(String deviceFleetName); /** *

* The Amazon Resource Name (ARN) of the device. *

* * @param roleArn * The Amazon Resource Name (ARN) of the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder roleArn(String roleArn); /** *

* Description of the fleet. *

* * @param description * Description of the fleet. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* Output configuration for storing sample data collected by the fleet. *

* * @param outputConfig * Output configuration for storing sample data collected by the fleet. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputConfig(EdgeOutputConfig outputConfig); /** *

* Output configuration for storing sample data collected by the fleet. *

* This is a convenience method that creates an instance of the {@link EdgeOutputConfig.Builder} avoiding the * need to create one manually via {@link EdgeOutputConfig#builder()}. * *

* When the {@link Consumer} completes, {@link EdgeOutputConfig.Builder#build()} is called immediately and its * result is passed to {@link #outputConfig(EdgeOutputConfig)}. * * @param outputConfig * a consumer that will call methods on {@link EdgeOutputConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #outputConfig(EdgeOutputConfig) */ default Builder outputConfig(Consumer outputConfig) { return outputConfig(EdgeOutputConfig.builder().applyMutation(outputConfig).build()); } /** *

* 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". *

* * @param enableIotRoleAlias * 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 Returns a reference to this object so that method calls can be chained together. */ Builder enableIotRoleAlias(Boolean enableIotRoleAlias); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends SageMakerRequest.BuilderImpl implements Builder { private String deviceFleetName; private String roleArn; private String description; private EdgeOutputConfig outputConfig; private Boolean enableIotRoleAlias; private BuilderImpl() { } private BuilderImpl(UpdateDeviceFleetRequest model) { super(model); deviceFleetName(model.deviceFleetName); roleArn(model.roleArn); description(model.description); outputConfig(model.outputConfig); enableIotRoleAlias(model.enableIotRoleAlias); } public final String getDeviceFleetName() { return deviceFleetName; } public final void setDeviceFleetName(String deviceFleetName) { this.deviceFleetName = deviceFleetName; } @Override public final Builder deviceFleetName(String deviceFleetName) { this.deviceFleetName = deviceFleetName; return this; } public final String getRoleArn() { return roleArn; } public final void setRoleArn(String roleArn) { this.roleArn = roleArn; } @Override public final Builder roleArn(String roleArn) { this.roleArn = roleArn; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final EdgeOutputConfig.Builder getOutputConfig() { return outputConfig != null ? outputConfig.toBuilder() : null; } public final void setOutputConfig(EdgeOutputConfig.BuilderImpl outputConfig) { this.outputConfig = outputConfig != null ? outputConfig.build() : null; } @Override public final Builder outputConfig(EdgeOutputConfig outputConfig) { this.outputConfig = outputConfig; return this; } public final Boolean getEnableIotRoleAlias() { return enableIotRoleAlias; } public final void setEnableIotRoleAlias(Boolean enableIotRoleAlias) { this.enableIotRoleAlias = enableIotRoleAlias; } @Override public final Builder enableIotRoleAlias(Boolean enableIotRoleAlias) { this.enableIotRoleAlias = enableIotRoleAlias; 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 UpdateDeviceFleetRequest build() { return new UpdateDeviceFleetRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy