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

software.amazon.awssdk.services.workdocs.model.DescribeUsersRequest 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.29.39
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 DescribeUsersRequest extends WorkDocsRequest implements
        ToCopyableBuilder {
    private static final SdkField AUTHENTICATION_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("AuthenticationToken").getter(getter(DescribeUsersRequest::authenticationToken))
            .setter(setter(Builder::authenticationToken))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Authentication").build()).build();

    private static final SdkField ORGANIZATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("OrganizationId").getter(getter(DescribeUsersRequest::organizationId))
            .setter(setter(Builder::organizationId))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("organizationId").build())
            .build();

    private static final SdkField USER_IDS_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("UserIds").getter(getter(DescribeUsersRequest::userIds)).setter(setter(Builder::userIds))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("userIds").build()).build();

    private static final SdkField QUERY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Query")
            .getter(getter(DescribeUsersRequest::query)).setter(setter(Builder::query))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("query").build()).build();

    private static final SdkField INCLUDE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Include")
            .getter(getter(DescribeUsersRequest::includeAsString)).setter(setter(Builder::include))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("include").build()).build();

    private static final SdkField ORDER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Order")
            .getter(getter(DescribeUsersRequest::orderAsString)).setter(setter(Builder::order))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("order").build()).build();

    private static final SdkField SORT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Sort")
            .getter(getter(DescribeUsersRequest::sortAsString)).setter(setter(Builder::sort))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("sort").build()).build();

    private static final SdkField MARKER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Marker")
            .getter(getter(DescribeUsersRequest::marker)).setter(setter(Builder::marker))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("marker").build()).build();

    private static final SdkField LIMIT_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Limit")
            .getter(getter(DescribeUsersRequest::limit)).setter(setter(Builder::limit))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("limit").build()).build();

    private static final SdkField FIELDS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Fields")
            .getter(getter(DescribeUsersRequest::fields)).setter(setter(Builder::fields))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("fields").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AUTHENTICATION_TOKEN_FIELD,
            ORGANIZATION_ID_FIELD, USER_IDS_FIELD, QUERY_FIELD, INCLUDE_FIELD, ORDER_FIELD, SORT_FIELD, MARKER_FIELD,
            LIMIT_FIELD, FIELDS_FIELD));

    private final String authenticationToken;

    private final String organizationId;

    private final String userIds;

    private final String query;

    private final String include;

    private final String order;

    private final String sort;

    private final String marker;

    private final Integer limit;

    private final String fields;

    private DescribeUsersRequest(BuilderImpl builder) {
        super(builder);
        this.authenticationToken = builder.authenticationToken;
        this.organizationId = builder.organizationId;
        this.userIds = builder.userIds;
        this.query = builder.query;
        this.include = builder.include;
        this.order = builder.order;
        this.sort = builder.sort;
        this.marker = builder.marker;
        this.limit = builder.limit;
        this.fields = builder.fields;
    }

    /**
     * 

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

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

* The IDs of the users. *

* * @return The IDs of the users. */ public final String userIds() { return userIds; } /** *

* A query to filter users by user name. Remember the following about the Userids and * Query parameters: *

*
    *
  • *

    * If you don't use either parameter, the API returns a paginated list of all users on the site. *

    *
  • *
  • *

    * If you use both parameters, the API ignores the Query parameter. *

    *
  • *
  • *

    * The Userid parameter only returns user names that match a corresponding user ID. *

    *
  • *
  • *

    * The Query parameter runs a "prefix" search for users by the GivenName, * SurName, or UserName fields included in a CreateUser API call. For * example, querying on Ma returns Márcia Oliveira, María García, and Mateo Jackson. If you use * multiple characters, the API only returns data that matches all characters. For example, querying on * Ma J only returns Mateo Jackson. *

    *
  • *
* * @return A query to filter users by user name. Remember the following about the Userids and * Query parameters:

*
    *
  • *

    * If you don't use either parameter, the API returns a paginated list of all users on the site. *

    *
  • *
  • *

    * If you use both parameters, the API ignores the Query parameter. *

    *
  • *
  • *

    * The Userid parameter only returns user names that match a corresponding user ID. *

    *
  • *
  • *

    * The Query parameter runs a "prefix" search for users by the GivenName, * SurName, or UserName fields included in a CreateUser API * call. For example, querying on Ma returns Márcia Oliveira, María García, and Mateo Jackson. * If you use multiple characters, the API only returns data that matches all characters. For example, * querying on Ma J only returns Mateo Jackson. *

    *
  • */ public final String query() { return query; } /** *

    * The state of the users. Specify "ALL" to include inactive users. *

    *

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

    * * @return The state of the users. Specify "ALL" to include inactive users. * @see UserFilterType */ public final UserFilterType include() { return UserFilterType.fromValue(include); } /** *

    * The state of the users. Specify "ALL" to include inactive users. *

    *

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

    * * @return The state of the users. Specify "ALL" to include inactive users. * @see UserFilterType */ public final String includeAsString() { return include; } /** *

    * The order for the results. *

    *

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

    * * @return The order for the results. * @see OrderType */ public final OrderType order() { return OrderType.fromValue(order); } /** *

    * The order for the results. *

    *

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

    * * @return The order for the results. * @see OrderType */ public final String orderAsString() { return order; } /** *

    * The sorting criteria. *

    *

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

    * * @return The sorting criteria. * @see UserSortType */ public final UserSortType sort() { return UserSortType.fromValue(sort); } /** *

    * The sorting criteria. *

    *

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

    * * @return The sorting criteria. * @see UserSortType */ public final String sortAsString() { return sort; } /** *

    * The marker for the next set of results. (You received this marker from a previous call.) *

    * * @return The marker for the next set of results. (You received this marker from a previous call.) */ public final String marker() { return marker; } /** *

    * The maximum number of items to return. *

    * * @return The maximum number of items to return. */ public final Integer limit() { return limit; } /** *

    * A comma-separated list of values. Specify "STORAGE_METADATA" to include the user storage quota and utilization * information. *

    * * @return A comma-separated list of values. Specify "STORAGE_METADATA" to include the user storage quota and * utilization information. */ public final String fields() { return fields; } @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(organizationId()); hashCode = 31 * hashCode + Objects.hashCode(userIds()); hashCode = 31 * hashCode + Objects.hashCode(query()); hashCode = 31 * hashCode + Objects.hashCode(includeAsString()); hashCode = 31 * hashCode + Objects.hashCode(orderAsString()); hashCode = 31 * hashCode + Objects.hashCode(sortAsString()); hashCode = 31 * hashCode + Objects.hashCode(marker()); hashCode = 31 * hashCode + Objects.hashCode(limit()); hashCode = 31 * hashCode + Objects.hashCode(fields()); 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 DescribeUsersRequest)) { return false; } DescribeUsersRequest other = (DescribeUsersRequest) obj; return Objects.equals(authenticationToken(), other.authenticationToken()) && Objects.equals(organizationId(), other.organizationId()) && Objects.equals(userIds(), other.userIds()) && Objects.equals(query(), other.query()) && Objects.equals(includeAsString(), other.includeAsString()) && Objects.equals(orderAsString(), other.orderAsString()) && Objects.equals(sortAsString(), other.sortAsString()) && Objects.equals(marker(), other.marker()) && Objects.equals(limit(), other.limit()) && Objects.equals(fields(), other.fields()); } /** * 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("DescribeUsersRequest") .add("AuthenticationToken", authenticationToken() == null ? null : "*** Sensitive Data Redacted ***") .add("OrganizationId", organizationId()).add("UserIds", userIds()) .add("Query", query() == null ? null : "*** Sensitive Data Redacted ***").add("Include", includeAsString()) .add("Order", orderAsString()).add("Sort", sortAsString()).add("Marker", marker()).add("Limit", limit()) .add("Fields", fields()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AuthenticationToken": return Optional.ofNullable(clazz.cast(authenticationToken())); case "OrganizationId": return Optional.ofNullable(clazz.cast(organizationId())); case "UserIds": return Optional.ofNullable(clazz.cast(userIds())); case "Query": return Optional.ofNullable(clazz.cast(query())); case "Include": return Optional.ofNullable(clazz.cast(includeAsString())); case "Order": return Optional.ofNullable(clazz.cast(orderAsString())); case "Sort": return Optional.ofNullable(clazz.cast(sortAsString())); case "Marker": return Optional.ofNullable(clazz.cast(marker())); case "Limit": return Optional.ofNullable(clazz.cast(limit())); case "Fields": return Optional.ofNullable(clazz.cast(fields())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeUsersRequest) 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 organization. *

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

    * The IDs of the users. *

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

    * A query to filter users by user name. Remember the following about the Userids and * Query parameters: *

    *
      *
    • *

      * If you don't use either parameter, the API returns a paginated list of all users on the site. *

      *
    • *
    • *

      * If you use both parameters, the API ignores the Query parameter. *

      *
    • *
    • *

      * The Userid parameter only returns user names that match a corresponding user ID. *

      *
    • *
    • *

      * The Query parameter runs a "prefix" search for users by the GivenName, * SurName, or UserName fields included in a CreateUser API call. * For example, querying on Ma returns Márcia Oliveira, María García, and Mateo Jackson. If you use * multiple characters, the API only returns data that matches all characters. For example, querying on * Ma J only returns Mateo Jackson. *

      *
    • *
    * * @param query * A query to filter users by user name. Remember the following about the Userids and * Query parameters:

    *
      *
    • *

      * If you don't use either parameter, the API returns a paginated list of all users on the site. *

      *
    • *
    • *

      * If you use both parameters, the API ignores the Query parameter. *

      *
    • *
    • *

      * The Userid parameter only returns user names that match a corresponding user ID. *

      *
    • *
    • *

      * The Query parameter runs a "prefix" search for users by the GivenName, * SurName, or UserName fields included in a CreateUser API * call. For example, querying on Ma returns Márcia Oliveira, María García, and Mateo * Jackson. If you use multiple characters, the API only returns data that matches all characters. For * example, querying on Ma J only returns Mateo Jackson. *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder query(String query); /** *

      * The state of the users. Specify "ALL" to include inactive users. *

      * * @param include * The state of the users. Specify "ALL" to include inactive users. * @see UserFilterType * @return Returns a reference to this object so that method calls can be chained together. * @see UserFilterType */ Builder include(String include); /** *

      * The state of the users. Specify "ALL" to include inactive users. *

      * * @param include * The state of the users. Specify "ALL" to include inactive users. * @see UserFilterType * @return Returns a reference to this object so that method calls can be chained together. * @see UserFilterType */ Builder include(UserFilterType include); /** *

      * The order for the results. *

      * * @param order * The order for the results. * @see OrderType * @return Returns a reference to this object so that method calls can be chained together. * @see OrderType */ Builder order(String order); /** *

      * The order for the results. *

      * * @param order * The order for the results. * @see OrderType * @return Returns a reference to this object so that method calls can be chained together. * @see OrderType */ Builder order(OrderType order); /** *

      * The sorting criteria. *

      * * @param sort * The sorting criteria. * @see UserSortType * @return Returns a reference to this object so that method calls can be chained together. * @see UserSortType */ Builder sort(String sort); /** *

      * The sorting criteria. *

      * * @param sort * The sorting criteria. * @see UserSortType * @return Returns a reference to this object so that method calls can be chained together. * @see UserSortType */ Builder sort(UserSortType sort); /** *

      * The marker for the next set of results. (You received this marker from a previous call.) *

      * * @param marker * The marker for the next set of results. (You received this marker from a previous call.) * @return Returns a reference to this object so that method calls can be chained together. */ Builder marker(String marker); /** *

      * The maximum number of items to return. *

      * * @param limit * The maximum number of items to return. * @return Returns a reference to this object so that method calls can be chained together. */ Builder limit(Integer limit); /** *

      * A comma-separated list of values. Specify "STORAGE_METADATA" to include the user storage quota and * utilization information. *

      * * @param fields * A comma-separated list of values. Specify "STORAGE_METADATA" to include the user storage quota and * utilization information. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fields(String fields); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends WorkDocsRequest.BuilderImpl implements Builder { private String authenticationToken; private String organizationId; private String userIds; private String query; private String include; private String order; private String sort; private String marker; private Integer limit; private String fields; private BuilderImpl() { } private BuilderImpl(DescribeUsersRequest model) { super(model); authenticationToken(model.authenticationToken); organizationId(model.organizationId); userIds(model.userIds); query(model.query); include(model.include); order(model.order); sort(model.sort); marker(model.marker); limit(model.limit); fields(model.fields); } 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 getOrganizationId() { return organizationId; } public final void setOrganizationId(String organizationId) { this.organizationId = organizationId; } @Override public final Builder organizationId(String organizationId) { this.organizationId = organizationId; return this; } public final String getUserIds() { return userIds; } public final void setUserIds(String userIds) { this.userIds = userIds; } @Override public final Builder userIds(String userIds) { this.userIds = userIds; return this; } public final String getQuery() { return query; } public final void setQuery(String query) { this.query = query; } @Override public final Builder query(String query) { this.query = query; return this; } public final String getInclude() { return include; } public final void setInclude(String include) { this.include = include; } @Override public final Builder include(String include) { this.include = include; return this; } @Override public final Builder include(UserFilterType include) { this.include(include == null ? null : include.toString()); return this; } public final String getOrder() { return order; } public final void setOrder(String order) { this.order = order; } @Override public final Builder order(String order) { this.order = order; return this; } @Override public final Builder order(OrderType order) { this.order(order == null ? null : order.toString()); return this; } public final String getSort() { return sort; } public final void setSort(String sort) { this.sort = sort; } @Override public final Builder sort(String sort) { this.sort = sort; return this; } @Override public final Builder sort(UserSortType sort) { this.sort(sort == null ? null : sort.toString()); return this; } public final String getMarker() { return marker; } public final void setMarker(String marker) { this.marker = marker; } @Override public final Builder marker(String marker) { this.marker = marker; return this; } public final Integer getLimit() { return limit; } public final void setLimit(Integer limit) { this.limit = limit; } @Override public final Builder limit(Integer limit) { this.limit = limit; return this; } public final String getFields() { return fields; } public final void setFields(String fields) { this.fields = fields; } @Override public final Builder fields(String fields) { this.fields = fields; 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 DescribeUsersRequest build() { return new DescribeUsersRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy