software.amazon.awssdk.services.datazone.model.ListSubscriptionGrantsRequest Maven / Gradle / Ivy
Show all versions of datazone 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.datazone.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 ListSubscriptionGrantsRequest extends DataZoneRequest implements
ToCopyableBuilder {
private static final SdkField DOMAIN_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("domainIdentifier").getter(getter(ListSubscriptionGrantsRequest::domainIdentifier))
.setter(setter(Builder::domainIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("domainIdentifier").build()).build();
private static final SdkField ENVIRONMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("environmentId").getter(getter(ListSubscriptionGrantsRequest::environmentId))
.setter(setter(Builder::environmentId))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("environmentId").build()).build();
private static final SdkField MAX_RESULTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("maxResults").getter(getter(ListSubscriptionGrantsRequest::maxResults))
.setter(setter(Builder::maxResults))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("maxResults").build()).build();
private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("nextToken").getter(getter(ListSubscriptionGrantsRequest::nextToken)).setter(setter(Builder::nextToken))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("nextToken").build()).build();
private static final SdkField OWNING_PROJECT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("owningProjectId").getter(getter(ListSubscriptionGrantsRequest::owningProjectId))
.setter(setter(Builder::owningProjectId))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("owningProjectId").build())
.build();
private static final SdkField SORT_BY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("sortBy")
.getter(getter(ListSubscriptionGrantsRequest::sortByAsString)).setter(setter(Builder::sortBy))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("sortBy").build()).build();
private static final SdkField SORT_ORDER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("sortOrder").getter(getter(ListSubscriptionGrantsRequest::sortOrderAsString))
.setter(setter(Builder::sortOrder))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("sortOrder").build()).build();
private static final SdkField SUBSCRIBED_LISTING_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("subscribedListingId").getter(getter(ListSubscriptionGrantsRequest::subscribedListingId))
.setter(setter(Builder::subscribedListingId))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("subscribedListingId").build())
.build();
private static final SdkField SUBSCRIPTION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("subscriptionId").getter(getter(ListSubscriptionGrantsRequest::subscriptionId))
.setter(setter(Builder::subscriptionId))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("subscriptionId").build())
.build();
private static final SdkField SUBSCRIPTION_TARGET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("subscriptionTargetId").getter(getter(ListSubscriptionGrantsRequest::subscriptionTargetId))
.setter(setter(Builder::subscriptionTargetId))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("subscriptionTargetId").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DOMAIN_IDENTIFIER_FIELD,
ENVIRONMENT_ID_FIELD, MAX_RESULTS_FIELD, NEXT_TOKEN_FIELD, OWNING_PROJECT_ID_FIELD, SORT_BY_FIELD, SORT_ORDER_FIELD,
SUBSCRIBED_LISTING_ID_FIELD, SUBSCRIPTION_ID_FIELD, SUBSCRIPTION_TARGET_ID_FIELD));
private final String domainIdentifier;
private final String environmentId;
private final Integer maxResults;
private final String nextToken;
private final String owningProjectId;
private final String sortBy;
private final String sortOrder;
private final String subscribedListingId;
private final String subscriptionId;
private final String subscriptionTargetId;
private ListSubscriptionGrantsRequest(BuilderImpl builder) {
super(builder);
this.domainIdentifier = builder.domainIdentifier;
this.environmentId = builder.environmentId;
this.maxResults = builder.maxResults;
this.nextToken = builder.nextToken;
this.owningProjectId = builder.owningProjectId;
this.sortBy = builder.sortBy;
this.sortOrder = builder.sortOrder;
this.subscribedListingId = builder.subscribedListingId;
this.subscriptionId = builder.subscriptionId;
this.subscriptionTargetId = builder.subscriptionTargetId;
}
/**
*
* The identifier of the Amazon DataZone domain.
*
*
* @return The identifier of the Amazon DataZone domain.
*/
public final String domainIdentifier() {
return domainIdentifier;
}
/**
*
* The identifier of the Amazon DataZone environment.
*
*
* @return The identifier of the Amazon DataZone environment.
*/
public final String environmentId() {
return environmentId;
}
/**
*
* The maximum number of subscription grants to return in a single call to ListSubscriptionGrants
. When
* the number of subscription grants to be listed is greater than the value of MaxResults
, the response
* contains a NextToken
value that you can use in a subsequent call to
* ListSubscriptionGrants
to list the next set of subscription grants.
*
*
* @return The maximum number of subscription grants to return in a single call to
* ListSubscriptionGrants
. When the number of subscription grants to be listed is greater than
* the value of MaxResults
, the response contains a NextToken
value that you can
* use in a subsequent call to ListSubscriptionGrants
to list the next set of subscription
* grants.
*/
public final Integer maxResults() {
return maxResults;
}
/**
*
* When the number of subscription grants is greater than the default value for the MaxResults
* parameter, or if you explicitly specify a value for MaxResults
that is less than the number of
* subscription grants, the response includes a pagination token named NextToken
. You can specify this
* NextToken
value in a subsequent call to ListSubscriptionGrants
to list the next set of
* subscription grants.
*
*
* @return When the number of subscription grants is greater than the default value for the MaxResults
* parameter, or if you explicitly specify a value for MaxResults
that is less than the number
* of subscription grants, the response includes a pagination token named NextToken
. You can
* specify this NextToken
value in a subsequent call to ListSubscriptionGrants
to
* list the next set of subscription grants.
*/
public final String nextToken() {
return nextToken;
}
/**
*
* The ID of the owning project of the subscription grants.
*
*
* @return The ID of the owning project of the subscription grants.
*/
public final String owningProjectId() {
return owningProjectId;
}
/**
*
* Specifies the way of sorting the results of this action.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sortBy} will
* return {@link SortKey#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sortByAsString}.
*
*
* @return Specifies the way of sorting the results of this action.
* @see SortKey
*/
public final SortKey sortBy() {
return SortKey.fromValue(sortBy);
}
/**
*
* Specifies the way of sorting the results of this action.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sortBy} will
* return {@link SortKey#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sortByAsString}.
*
*
* @return Specifies the way of sorting the results of this action.
* @see SortKey
*/
public final String sortByAsString() {
return sortBy;
}
/**
*
* Specifies the sort order of this action.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sortOrder} will
* return {@link SortOrder#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sortOrderAsString}.
*
*
* @return Specifies the sort order of this action.
* @see SortOrder
*/
public final SortOrder sortOrder() {
return SortOrder.fromValue(sortOrder);
}
/**
*
* Specifies the sort order of this action.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sortOrder} will
* return {@link SortOrder#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sortOrderAsString}.
*
*
* @return Specifies the sort order of this action.
* @see SortOrder
*/
public final String sortOrderAsString() {
return sortOrder;
}
/**
*
* The identifier of the subscribed listing.
*
*
* @return The identifier of the subscribed listing.
*/
public final String subscribedListingId() {
return subscribedListingId;
}
/**
*
* The identifier of the subscription.
*
*
* @return The identifier of the subscription.
*/
public final String subscriptionId() {
return subscriptionId;
}
/**
*
* The identifier of the subscription target.
*
*
* @return The identifier of the subscription target.
*/
public final String subscriptionTargetId() {
return subscriptionTargetId;
}
@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(domainIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(environmentId());
hashCode = 31 * hashCode + Objects.hashCode(maxResults());
hashCode = 31 * hashCode + Objects.hashCode(nextToken());
hashCode = 31 * hashCode + Objects.hashCode(owningProjectId());
hashCode = 31 * hashCode + Objects.hashCode(sortByAsString());
hashCode = 31 * hashCode + Objects.hashCode(sortOrderAsString());
hashCode = 31 * hashCode + Objects.hashCode(subscribedListingId());
hashCode = 31 * hashCode + Objects.hashCode(subscriptionId());
hashCode = 31 * hashCode + Objects.hashCode(subscriptionTargetId());
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 ListSubscriptionGrantsRequest)) {
return false;
}
ListSubscriptionGrantsRequest other = (ListSubscriptionGrantsRequest) obj;
return Objects.equals(domainIdentifier(), other.domainIdentifier())
&& Objects.equals(environmentId(), other.environmentId()) && Objects.equals(maxResults(), other.maxResults())
&& Objects.equals(nextToken(), other.nextToken()) && Objects.equals(owningProjectId(), other.owningProjectId())
&& Objects.equals(sortByAsString(), other.sortByAsString())
&& Objects.equals(sortOrderAsString(), other.sortOrderAsString())
&& Objects.equals(subscribedListingId(), other.subscribedListingId())
&& Objects.equals(subscriptionId(), other.subscriptionId())
&& Objects.equals(subscriptionTargetId(), other.subscriptionTargetId());
}
/**
* 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("ListSubscriptionGrantsRequest").add("DomainIdentifier", domainIdentifier())
.add("EnvironmentId", environmentId()).add("MaxResults", maxResults()).add("NextToken", nextToken())
.add("OwningProjectId", owningProjectId()).add("SortBy", sortByAsString()).add("SortOrder", sortOrderAsString())
.add("SubscribedListingId", subscribedListingId()).add("SubscriptionId", subscriptionId())
.add("SubscriptionTargetId", subscriptionTargetId()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "domainIdentifier":
return Optional.ofNullable(clazz.cast(domainIdentifier()));
case "environmentId":
return Optional.ofNullable(clazz.cast(environmentId()));
case "maxResults":
return Optional.ofNullable(clazz.cast(maxResults()));
case "nextToken":
return Optional.ofNullable(clazz.cast(nextToken()));
case "owningProjectId":
return Optional.ofNullable(clazz.cast(owningProjectId()));
case "sortBy":
return Optional.ofNullable(clazz.cast(sortByAsString()));
case "sortOrder":
return Optional.ofNullable(clazz.cast(sortOrderAsString()));
case "subscribedListingId":
return Optional.ofNullable(clazz.cast(subscribedListingId()));
case "subscriptionId":
return Optional.ofNullable(clazz.cast(subscriptionId()));
case "subscriptionTargetId":
return Optional.ofNullable(clazz.cast(subscriptionTargetId()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function