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

software.amazon.awssdk.services.workspaces.model.SelfservicePermissions Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.15
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.workspaces.model;

import java.io.Serializable;
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.Function;
import software.amazon.awssdk.annotations.Generated;
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;

/**
 * 

* Describes the self-service permissions for a directory. For more information, see Enable Self-Service WorkSpace Management Capabilities for Your Users. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SelfservicePermissions implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField RESTART_WORKSPACE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RestartWorkspace").getter(getter(SelfservicePermissions::restartWorkspaceAsString)) .setter(setter(Builder::restartWorkspace)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RestartWorkspace").build()).build(); private static final SdkField INCREASE_VOLUME_SIZE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("IncreaseVolumeSize").getter(getter(SelfservicePermissions::increaseVolumeSizeAsString)) .setter(setter(Builder::increaseVolumeSize)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IncreaseVolumeSize").build()) .build(); private static final SdkField CHANGE_COMPUTE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ChangeComputeType").getter(getter(SelfservicePermissions::changeComputeTypeAsString)) .setter(setter(Builder::changeComputeType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeComputeType").build()).build(); private static final SdkField SWITCH_RUNNING_MODE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SwitchRunningMode").getter(getter(SelfservicePermissions::switchRunningModeAsString)) .setter(setter(Builder::switchRunningMode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SwitchRunningMode").build()).build(); private static final SdkField REBUILD_WORKSPACE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RebuildWorkspace").getter(getter(SelfservicePermissions::rebuildWorkspaceAsString)) .setter(setter(Builder::rebuildWorkspace)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RebuildWorkspace").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(RESTART_WORKSPACE_FIELD, INCREASE_VOLUME_SIZE_FIELD, CHANGE_COMPUTE_TYPE_FIELD, SWITCH_RUNNING_MODE_FIELD, REBUILD_WORKSPACE_FIELD)); private static final long serialVersionUID = 1L; private final String restartWorkspace; private final String increaseVolumeSize; private final String changeComputeType; private final String switchRunningMode; private final String rebuildWorkspace; private SelfservicePermissions(BuilderImpl builder) { this.restartWorkspace = builder.restartWorkspace; this.increaseVolumeSize = builder.increaseVolumeSize; this.changeComputeType = builder.changeComputeType; this.switchRunningMode = builder.switchRunningMode; this.rebuildWorkspace = builder.rebuildWorkspace; } /** *

* Specifies whether users can restart their WorkSpace. *

*

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

* * @return Specifies whether users can restart their WorkSpace. * @see ReconnectEnum */ public final ReconnectEnum restartWorkspace() { return ReconnectEnum.fromValue(restartWorkspace); } /** *

* Specifies whether users can restart their WorkSpace. *

*

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

* * @return Specifies whether users can restart their WorkSpace. * @see ReconnectEnum */ public final String restartWorkspaceAsString() { return restartWorkspace; } /** *

* Specifies whether users can increase the volume size of the drives on their WorkSpace. *

*

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

* * @return Specifies whether users can increase the volume size of the drives on their WorkSpace. * @see ReconnectEnum */ public final ReconnectEnum increaseVolumeSize() { return ReconnectEnum.fromValue(increaseVolumeSize); } /** *

* Specifies whether users can increase the volume size of the drives on their WorkSpace. *

*

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

* * @return Specifies whether users can increase the volume size of the drives on their WorkSpace. * @see ReconnectEnum */ public final String increaseVolumeSizeAsString() { return increaseVolumeSize; } /** *

* Specifies whether users can change the compute type (bundle) for their WorkSpace. *

*

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

* * @return Specifies whether users can change the compute type (bundle) for their WorkSpace. * @see ReconnectEnum */ public final ReconnectEnum changeComputeType() { return ReconnectEnum.fromValue(changeComputeType); } /** *

* Specifies whether users can change the compute type (bundle) for their WorkSpace. *

*

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

* * @return Specifies whether users can change the compute type (bundle) for their WorkSpace. * @see ReconnectEnum */ public final String changeComputeTypeAsString() { return changeComputeType; } /** *

* Specifies whether users can switch the running mode of their WorkSpace. *

*

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

* * @return Specifies whether users can switch the running mode of their WorkSpace. * @see ReconnectEnum */ public final ReconnectEnum switchRunningMode() { return ReconnectEnum.fromValue(switchRunningMode); } /** *

* Specifies whether users can switch the running mode of their WorkSpace. *

*

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

* * @return Specifies whether users can switch the running mode of their WorkSpace. * @see ReconnectEnum */ public final String switchRunningModeAsString() { return switchRunningMode; } /** *

* Specifies whether users can rebuild the operating system of a WorkSpace to its original state. *

*

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

* * @return Specifies whether users can rebuild the operating system of a WorkSpace to its original state. * @see ReconnectEnum */ public final ReconnectEnum rebuildWorkspace() { return ReconnectEnum.fromValue(rebuildWorkspace); } /** *

* Specifies whether users can rebuild the operating system of a WorkSpace to its original state. *

*

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

* * @return Specifies whether users can rebuild the operating system of a WorkSpace to its original state. * @see ReconnectEnum */ public final String rebuildWorkspaceAsString() { return rebuildWorkspace; } @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 + Objects.hashCode(restartWorkspaceAsString()); hashCode = 31 * hashCode + Objects.hashCode(increaseVolumeSizeAsString()); hashCode = 31 * hashCode + Objects.hashCode(changeComputeTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(switchRunningModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(rebuildWorkspaceAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SelfservicePermissions)) { return false; } SelfservicePermissions other = (SelfservicePermissions) obj; return Objects.equals(restartWorkspaceAsString(), other.restartWorkspaceAsString()) && Objects.equals(increaseVolumeSizeAsString(), other.increaseVolumeSizeAsString()) && Objects.equals(changeComputeTypeAsString(), other.changeComputeTypeAsString()) && Objects.equals(switchRunningModeAsString(), other.switchRunningModeAsString()) && Objects.equals(rebuildWorkspaceAsString(), other.rebuildWorkspaceAsString()); } /** * 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("SelfservicePermissions").add("RestartWorkspace", restartWorkspaceAsString()) .add("IncreaseVolumeSize", increaseVolumeSizeAsString()).add("ChangeComputeType", changeComputeTypeAsString()) .add("SwitchRunningMode", switchRunningModeAsString()).add("RebuildWorkspace", rebuildWorkspaceAsString()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "RestartWorkspace": return Optional.ofNullable(clazz.cast(restartWorkspaceAsString())); case "IncreaseVolumeSize": return Optional.ofNullable(clazz.cast(increaseVolumeSizeAsString())); case "ChangeComputeType": return Optional.ofNullable(clazz.cast(changeComputeTypeAsString())); case "SwitchRunningMode": return Optional.ofNullable(clazz.cast(switchRunningModeAsString())); case "RebuildWorkspace": return Optional.ofNullable(clazz.cast(rebuildWorkspaceAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((SelfservicePermissions) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Specifies whether users can restart their WorkSpace. *

* * @param restartWorkspace * Specifies whether users can restart their WorkSpace. * @see ReconnectEnum * @return Returns a reference to this object so that method calls can be chained together. * @see ReconnectEnum */ Builder restartWorkspace(String restartWorkspace); /** *

* Specifies whether users can restart their WorkSpace. *

* * @param restartWorkspace * Specifies whether users can restart their WorkSpace. * @see ReconnectEnum * @return Returns a reference to this object so that method calls can be chained together. * @see ReconnectEnum */ Builder restartWorkspace(ReconnectEnum restartWorkspace); /** *

* Specifies whether users can increase the volume size of the drives on their WorkSpace. *

* * @param increaseVolumeSize * Specifies whether users can increase the volume size of the drives on their WorkSpace. * @see ReconnectEnum * @return Returns a reference to this object so that method calls can be chained together. * @see ReconnectEnum */ Builder increaseVolumeSize(String increaseVolumeSize); /** *

* Specifies whether users can increase the volume size of the drives on their WorkSpace. *

* * @param increaseVolumeSize * Specifies whether users can increase the volume size of the drives on their WorkSpace. * @see ReconnectEnum * @return Returns a reference to this object so that method calls can be chained together. * @see ReconnectEnum */ Builder increaseVolumeSize(ReconnectEnum increaseVolumeSize); /** *

* Specifies whether users can change the compute type (bundle) for their WorkSpace. *

* * @param changeComputeType * Specifies whether users can change the compute type (bundle) for their WorkSpace. * @see ReconnectEnum * @return Returns a reference to this object so that method calls can be chained together. * @see ReconnectEnum */ Builder changeComputeType(String changeComputeType); /** *

* Specifies whether users can change the compute type (bundle) for their WorkSpace. *

* * @param changeComputeType * Specifies whether users can change the compute type (bundle) for their WorkSpace. * @see ReconnectEnum * @return Returns a reference to this object so that method calls can be chained together. * @see ReconnectEnum */ Builder changeComputeType(ReconnectEnum changeComputeType); /** *

* Specifies whether users can switch the running mode of their WorkSpace. *

* * @param switchRunningMode * Specifies whether users can switch the running mode of their WorkSpace. * @see ReconnectEnum * @return Returns a reference to this object so that method calls can be chained together. * @see ReconnectEnum */ Builder switchRunningMode(String switchRunningMode); /** *

* Specifies whether users can switch the running mode of their WorkSpace. *

* * @param switchRunningMode * Specifies whether users can switch the running mode of their WorkSpace. * @see ReconnectEnum * @return Returns a reference to this object so that method calls can be chained together. * @see ReconnectEnum */ Builder switchRunningMode(ReconnectEnum switchRunningMode); /** *

* Specifies whether users can rebuild the operating system of a WorkSpace to its original state. *

* * @param rebuildWorkspace * Specifies whether users can rebuild the operating system of a WorkSpace to its original state. * @see ReconnectEnum * @return Returns a reference to this object so that method calls can be chained together. * @see ReconnectEnum */ Builder rebuildWorkspace(String rebuildWorkspace); /** *

* Specifies whether users can rebuild the operating system of a WorkSpace to its original state. *

* * @param rebuildWorkspace * Specifies whether users can rebuild the operating system of a WorkSpace to its original state. * @see ReconnectEnum * @return Returns a reference to this object so that method calls can be chained together. * @see ReconnectEnum */ Builder rebuildWorkspace(ReconnectEnum rebuildWorkspace); } static final class BuilderImpl implements Builder { private String restartWorkspace; private String increaseVolumeSize; private String changeComputeType; private String switchRunningMode; private String rebuildWorkspace; private BuilderImpl() { } private BuilderImpl(SelfservicePermissions model) { restartWorkspace(model.restartWorkspace); increaseVolumeSize(model.increaseVolumeSize); changeComputeType(model.changeComputeType); switchRunningMode(model.switchRunningMode); rebuildWorkspace(model.rebuildWorkspace); } public final String getRestartWorkspace() { return restartWorkspace; } public final void setRestartWorkspace(String restartWorkspace) { this.restartWorkspace = restartWorkspace; } @Override public final Builder restartWorkspace(String restartWorkspace) { this.restartWorkspace = restartWorkspace; return this; } @Override public final Builder restartWorkspace(ReconnectEnum restartWorkspace) { this.restartWorkspace(restartWorkspace == null ? null : restartWorkspace.toString()); return this; } public final String getIncreaseVolumeSize() { return increaseVolumeSize; } public final void setIncreaseVolumeSize(String increaseVolumeSize) { this.increaseVolumeSize = increaseVolumeSize; } @Override public final Builder increaseVolumeSize(String increaseVolumeSize) { this.increaseVolumeSize = increaseVolumeSize; return this; } @Override public final Builder increaseVolumeSize(ReconnectEnum increaseVolumeSize) { this.increaseVolumeSize(increaseVolumeSize == null ? null : increaseVolumeSize.toString()); return this; } public final String getChangeComputeType() { return changeComputeType; } public final void setChangeComputeType(String changeComputeType) { this.changeComputeType = changeComputeType; } @Override public final Builder changeComputeType(String changeComputeType) { this.changeComputeType = changeComputeType; return this; } @Override public final Builder changeComputeType(ReconnectEnum changeComputeType) { this.changeComputeType(changeComputeType == null ? null : changeComputeType.toString()); return this; } public final String getSwitchRunningMode() { return switchRunningMode; } public final void setSwitchRunningMode(String switchRunningMode) { this.switchRunningMode = switchRunningMode; } @Override public final Builder switchRunningMode(String switchRunningMode) { this.switchRunningMode = switchRunningMode; return this; } @Override public final Builder switchRunningMode(ReconnectEnum switchRunningMode) { this.switchRunningMode(switchRunningMode == null ? null : switchRunningMode.toString()); return this; } public final String getRebuildWorkspace() { return rebuildWorkspace; } public final void setRebuildWorkspace(String rebuildWorkspace) { this.rebuildWorkspace = rebuildWorkspace; } @Override public final Builder rebuildWorkspace(String rebuildWorkspace) { this.rebuildWorkspace = rebuildWorkspace; return this; } @Override public final Builder rebuildWorkspace(ReconnectEnum rebuildWorkspace) { this.rebuildWorkspace(rebuildWorkspace == null ? null : rebuildWorkspace.toString()); return this; } @Override public SelfservicePermissions build() { return new SelfservicePermissions(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy