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

software.amazon.awssdk.services.workdocs.model.UpdateUserRequest Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.30.1
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.workdocs.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 UpdateUserRequest extends WorkDocsRequest implements
        ToCopyableBuilder {
    private static final SdkField AUTHENTICATION_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("AuthenticationToken").getter(getter(UpdateUserRequest::authenticationToken))
            .setter(setter(Builder::authenticationToken))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Authentication").build()).build();

    private static final SdkField USER_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("UserId")
            .getter(getter(UpdateUserRequest::userId)).setter(setter(Builder::userId))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("UserId").build()).build();

    private static final SdkField GIVEN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("GivenName").getter(getter(UpdateUserRequest::givenName)).setter(setter(Builder::givenName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GivenName").build()).build();

    private static final SdkField SURNAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Surname")
            .getter(getter(UpdateUserRequest::surname)).setter(setter(Builder::surname))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Surname").build()).build();

    private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Type")
            .getter(getter(UpdateUserRequest::typeAsString)).setter(setter(Builder::type))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Type").build()).build();

    private static final SdkField STORAGE_RULE_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("StorageRule")
            .getter(getter(UpdateUserRequest::storageRule)).setter(setter(Builder::storageRule))
            .constructor(StorageRuleType::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageRule").build()).build();

    private static final SdkField TIME_ZONE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("TimeZoneId").getter(getter(UpdateUserRequest::timeZoneId)).setter(setter(Builder::timeZoneId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimeZoneId").build()).build();

    private static final SdkField LOCALE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Locale")
            .getter(getter(UpdateUserRequest::localeAsString)).setter(setter(Builder::locale))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Locale").build()).build();

    private static final SdkField GRANT_POWERUSER_PRIVILEGES_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("GrantPoweruserPrivileges").getter(getter(UpdateUserRequest::grantPoweruserPrivilegesAsString))
            .setter(setter(Builder::grantPoweruserPrivileges))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GrantPoweruserPrivileges").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AUTHENTICATION_TOKEN_FIELD,
            USER_ID_FIELD, GIVEN_NAME_FIELD, SURNAME_FIELD, TYPE_FIELD, STORAGE_RULE_FIELD, TIME_ZONE_ID_FIELD, LOCALE_FIELD,
            GRANT_POWERUSER_PRIVILEGES_FIELD));

    private final String authenticationToken;

    private final String userId;

    private final String givenName;

    private final String surname;

    private final String type;

    private final StorageRuleType storageRule;

    private final String timeZoneId;

    private final String locale;

    private final String grantPoweruserPrivileges;

    private UpdateUserRequest(BuilderImpl builder) {
        super(builder);
        this.authenticationToken = builder.authenticationToken;
        this.userId = builder.userId;
        this.givenName = builder.givenName;
        this.surname = builder.surname;
        this.type = builder.type;
        this.storageRule = builder.storageRule;
        this.timeZoneId = builder.timeZoneId;
        this.locale = builder.locale;
        this.grantPoweruserPrivileges = builder.grantPoweruserPrivileges;
    }

    /**
     * 

* Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to * access the API. *

* * @return Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator * credentials to access the API. */ public final String authenticationToken() { return authenticationToken; } /** *

* The ID of the user. *

* * @return The ID of the user. */ public final String userId() { return userId; } /** *

* The given name of the user. *

* * @return The given name of the user. */ public final String givenName() { return givenName; } /** *

* The surname of the user. *

* * @return The surname of the user. */ public final String surname() { return surname; } /** *

* The type of the user. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return * {@link UserType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #typeAsString}. *

* * @return The type of the user. * @see UserType */ public final UserType type() { return UserType.fromValue(type); } /** *

* The type of the user. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return * {@link UserType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #typeAsString}. *

* * @return The type of the user. * @see UserType */ public final String typeAsString() { return type; } /** *

* The amount of storage for the user. *

* * @return The amount of storage for the user. */ public final StorageRuleType storageRule() { return storageRule; } /** *

* The time zone ID of the user. *

* * @return The time zone ID of the user. */ public final String timeZoneId() { return timeZoneId; } /** *

* The locale of the user. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #locale} will * return {@link LocaleType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #localeAsString}. *

* * @return The locale of the user. * @see LocaleType */ public final LocaleType locale() { return LocaleType.fromValue(locale); } /** *

* The locale of the user. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #locale} will * return {@link LocaleType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #localeAsString}. *

* * @return The locale of the user. * @see LocaleType */ public final String localeAsString() { return locale; } /** *

* Boolean value to determine whether the user is granted Power user privileges. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #grantPoweruserPrivileges} will return {@link BooleanEnumType#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #grantPoweruserPrivilegesAsString}. *

* * @return Boolean value to determine whether the user is granted Power user privileges. * @see BooleanEnumType */ public final BooleanEnumType grantPoweruserPrivileges() { return BooleanEnumType.fromValue(grantPoweruserPrivileges); } /** *

* Boolean value to determine whether the user is granted Power user privileges. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #grantPoweruserPrivileges} will return {@link BooleanEnumType#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #grantPoweruserPrivilegesAsString}. *

* * @return Boolean value to determine whether the user is granted Power user privileges. * @see BooleanEnumType */ public final String grantPoweruserPrivilegesAsString() { return grantPoweruserPrivileges; } @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(authenticationToken()); hashCode = 31 * hashCode + Objects.hashCode(userId()); hashCode = 31 * hashCode + Objects.hashCode(givenName()); hashCode = 31 * hashCode + Objects.hashCode(surname()); hashCode = 31 * hashCode + Objects.hashCode(typeAsString()); hashCode = 31 * hashCode + Objects.hashCode(storageRule()); hashCode = 31 * hashCode + Objects.hashCode(timeZoneId()); hashCode = 31 * hashCode + Objects.hashCode(localeAsString()); hashCode = 31 * hashCode + Objects.hashCode(grantPoweruserPrivilegesAsString()); 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 UpdateUserRequest)) { return false; } UpdateUserRequest other = (UpdateUserRequest) obj; return Objects.equals(authenticationToken(), other.authenticationToken()) && Objects.equals(userId(), other.userId()) && Objects.equals(givenName(), other.givenName()) && Objects.equals(surname(), other.surname()) && Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(storageRule(), other.storageRule()) && Objects.equals(timeZoneId(), other.timeZoneId()) && Objects.equals(localeAsString(), other.localeAsString()) && Objects.equals(grantPoweruserPrivilegesAsString(), other.grantPoweruserPrivilegesAsString()); } /** * 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("UpdateUserRequest") .add("AuthenticationToken", authenticationToken() == null ? null : "*** Sensitive Data Redacted ***") .add("UserId", userId()).add("GivenName", givenName() == null ? null : "*** Sensitive Data Redacted ***") .add("Surname", surname() == null ? null : "*** Sensitive Data Redacted ***").add("Type", typeAsString()) .add("StorageRule", storageRule()).add("TimeZoneId", timeZoneId()).add("Locale", localeAsString()) .add("GrantPoweruserPrivileges", grantPoweruserPrivilegesAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AuthenticationToken": return Optional.ofNullable(clazz.cast(authenticationToken())); case "UserId": return Optional.ofNullable(clazz.cast(userId())); case "GivenName": return Optional.ofNullable(clazz.cast(givenName())); case "Surname": return Optional.ofNullable(clazz.cast(surname())); case "Type": return Optional.ofNullable(clazz.cast(typeAsString())); case "StorageRule": return Optional.ofNullable(clazz.cast(storageRule())); case "TimeZoneId": return Optional.ofNullable(clazz.cast(timeZoneId())); case "Locale": return Optional.ofNullable(clazz.cast(localeAsString())); case "GrantPoweruserPrivileges": return Optional.ofNullable(clazz.cast(grantPoweruserPrivilegesAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateUserRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends WorkDocsRequest.Builder, SdkPojo, CopyableBuilder { /** *

* Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials * to access the API. *

* * @param authenticationToken * Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator * credentials to access the API. * @return Returns a reference to this object so that method calls can be chained together. */ Builder authenticationToken(String authenticationToken); /** *

* The ID of the user. *

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

* The given name of the user. *

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

* The surname of the user. *

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

* The type of the user. *

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

* The type of the user. *

* * @param type * The type of the user. * @see UserType * @return Returns a reference to this object so that method calls can be chained together. * @see UserType */ Builder type(UserType type); /** *

* The amount of storage for the user. *

* * @param storageRule * The amount of storage for the user. * @return Returns a reference to this object so that method calls can be chained together. */ Builder storageRule(StorageRuleType storageRule); /** *

* The amount of storage for the user. *

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

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

* The time zone ID of the user. *

* * @param timeZoneId * The time zone ID of the user. * @return Returns a reference to this object so that method calls can be chained together. */ Builder timeZoneId(String timeZoneId); /** *

* The locale of the user. *

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

* The locale of the user. *

* * @param locale * The locale of the user. * @see LocaleType * @return Returns a reference to this object so that method calls can be chained together. * @see LocaleType */ Builder locale(LocaleType locale); /** *

* Boolean value to determine whether the user is granted Power user privileges. *

* * @param grantPoweruserPrivileges * Boolean value to determine whether the user is granted Power user privileges. * @see BooleanEnumType * @return Returns a reference to this object so that method calls can be chained together. * @see BooleanEnumType */ Builder grantPoweruserPrivileges(String grantPoweruserPrivileges); /** *

* Boolean value to determine whether the user is granted Power user privileges. *

* * @param grantPoweruserPrivileges * Boolean value to determine whether the user is granted Power user privileges. * @see BooleanEnumType * @return Returns a reference to this object so that method calls can be chained together. * @see BooleanEnumType */ Builder grantPoweruserPrivileges(BooleanEnumType grantPoweruserPrivileges); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends WorkDocsRequest.BuilderImpl implements Builder { private String authenticationToken; private String userId; private String givenName; private String surname; private String type; private StorageRuleType storageRule; private String timeZoneId; private String locale; private String grantPoweruserPrivileges; private BuilderImpl() { } private BuilderImpl(UpdateUserRequest model) { super(model); authenticationToken(model.authenticationToken); userId(model.userId); givenName(model.givenName); surname(model.surname); type(model.type); storageRule(model.storageRule); timeZoneId(model.timeZoneId); locale(model.locale); grantPoweruserPrivileges(model.grantPoweruserPrivileges); } public final String getAuthenticationToken() { return authenticationToken; } public final void setAuthenticationToken(String authenticationToken) { this.authenticationToken = authenticationToken; } @Override public final Builder authenticationToken(String authenticationToken) { this.authenticationToken = authenticationToken; return this; } public final String getUserId() { return userId; } public final void setUserId(String userId) { this.userId = userId; } @Override public final Builder userId(String userId) { this.userId = userId; return this; } public final String getGivenName() { return givenName; } public final void setGivenName(String givenName) { this.givenName = givenName; } @Override public final Builder givenName(String givenName) { this.givenName = givenName; return this; } public final String getSurname() { return surname; } public final void setSurname(String surname) { this.surname = surname; } @Override public final Builder surname(String surname) { this.surname = surname; return this; } public final String getType() { return type; } public final void setType(String type) { this.type = type; } @Override public final Builder type(String type) { this.type = type; return this; } @Override public final Builder type(UserType type) { this.type(type == null ? null : type.toString()); return this; } public final StorageRuleType.Builder getStorageRule() { return storageRule != null ? storageRule.toBuilder() : null; } public final void setStorageRule(StorageRuleType.BuilderImpl storageRule) { this.storageRule = storageRule != null ? storageRule.build() : null; } @Override public final Builder storageRule(StorageRuleType storageRule) { this.storageRule = storageRule; return this; } public final String getTimeZoneId() { return timeZoneId; } public final void setTimeZoneId(String timeZoneId) { this.timeZoneId = timeZoneId; } @Override public final Builder timeZoneId(String timeZoneId) { this.timeZoneId = timeZoneId; return this; } public final String getLocale() { return locale; } public final void setLocale(String locale) { this.locale = locale; } @Override public final Builder locale(String locale) { this.locale = locale; return this; } @Override public final Builder locale(LocaleType locale) { this.locale(locale == null ? null : locale.toString()); return this; } public final String getGrantPoweruserPrivileges() { return grantPoweruserPrivileges; } public final void setGrantPoweruserPrivileges(String grantPoweruserPrivileges) { this.grantPoweruserPrivileges = grantPoweruserPrivileges; } @Override public final Builder grantPoweruserPrivileges(String grantPoweruserPrivileges) { this.grantPoweruserPrivileges = grantPoweruserPrivileges; return this; } @Override public final Builder grantPoweruserPrivileges(BooleanEnumType grantPoweruserPrivileges) { this.grantPoweruserPrivileges(grantPoweruserPrivileges == null ? null : grantPoweruserPrivileges.toString()); 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 UpdateUserRequest build() { return new UpdateUserRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy