software.amazon.awssdk.services.workdocs.model.DescribeUsersRequest Maven / Gradle / Ivy
Show all versions of workdocs 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.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 extends Builder> 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