software.amazon.awssdk.services.iam.model.GetServiceLastAccessedDetailsWithEntitiesRequest Maven / Gradle / Ivy
Show all versions of iam 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.iam.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 GetServiceLastAccessedDetailsWithEntitiesRequest extends IamRequest
implements
ToCopyableBuilder {
private static final SdkField JOB_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("JobId")
.getter(getter(GetServiceLastAccessedDetailsWithEntitiesRequest::jobId)).setter(setter(Builder::jobId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobId").build()).build();
private static final SdkField SERVICE_NAMESPACE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ServiceNamespace").getter(getter(GetServiceLastAccessedDetailsWithEntitiesRequest::serviceNamespace))
.setter(setter(Builder::serviceNamespace))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceNamespace").build()).build();
private static final SdkField MAX_ITEMS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("MaxItems").getter(getter(GetServiceLastAccessedDetailsWithEntitiesRequest::maxItems))
.setter(setter(Builder::maxItems))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxItems").build()).build();
private static final SdkField MARKER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Marker")
.getter(getter(GetServiceLastAccessedDetailsWithEntitiesRequest::marker)).setter(setter(Builder::marker))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Marker").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(JOB_ID_FIELD,
SERVICE_NAMESPACE_FIELD, MAX_ITEMS_FIELD, MARKER_FIELD));
private final String jobId;
private final String serviceNamespace;
private final Integer maxItems;
private final String marker;
private GetServiceLastAccessedDetailsWithEntitiesRequest(BuilderImpl builder) {
super(builder);
this.jobId = builder.jobId;
this.serviceNamespace = builder.serviceNamespace;
this.maxItems = builder.maxItems;
this.marker = builder.marker;
}
/**
*
* The ID of the request generated by the GenerateServiceLastAccessedDetails
operation.
*
*
* @return The ID of the request generated by the GenerateServiceLastAccessedDetails
operation.
*/
public final String jobId() {
return jobId;
}
/**
*
* The service namespace for an Amazon Web Services service. Provide the service namespace to learn when the IAM
* entity last attempted to access the specified service.
*
*
* To learn the service namespace for a service, see Actions, resources, and condition keys for Amazon Web Services services in the IAM User Guide. Choose
* the name of the service to view details for that service. In the first paragraph, find the service prefix. For
* example, (service prefix: a4b)
. For more information about service namespaces, see Amazon Web Services service namespaces in the Amazon Web Services General Reference.
*
*
* @return The service namespace for an Amazon Web Services service. Provide the service namespace to learn when the
* IAM entity last attempted to access the specified service.
*
* To learn the service namespace for a service, see Actions, resources, and condition keys for Amazon Web Services services in the IAM User
* Guide. Choose the name of the service to view details for that service. In the first paragraph, find
* the service prefix. For example, (service prefix: a4b)
. For more information about service
* namespaces, see Amazon Web Services service namespaces in the Amazon Web Services General Reference.
*/
public final String serviceNamespace() {
return serviceNamespace;
}
/**
*
* Use this only when paginating results to indicate the maximum number of items you want in the response. If
* additional items exist beyond the maximum you specify, the IsTruncated
response element is
* true
.
*
*
* If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer
* results, even when there are more results available. In that case, the IsTruncated
response element
* returns true
, and Marker
contains a value to include in the subsequent call that tells
* the service where to continue from.
*
*
* @return Use this only when paginating results to indicate the maximum number of items you want in the response.
* If additional items exist beyond the maximum you specify, the IsTruncated
response element
* is true
.
*
* If you do not include this parameter, the number of items defaults to 100. Note that IAM might return
* fewer results, even when there are more results available. In that case, the IsTruncated
* response element returns true
, and Marker
contains a value to include in the
* subsequent call that tells the service where to continue from.
*/
public final Integer maxItems() {
return maxItems;
}
/**
*
* Use this parameter only when paginating results and only after you receive a response indicating that the results
* are truncated. Set it to the value of the Marker
element in the response that you received to
* indicate where the next call should start.
*
*
* @return Use this parameter only when paginating results and only after you receive a response indicating that the
* results are truncated. Set it to the value of the Marker
element in the response that you
* received to indicate where the next call should start.
*/
public final String marker() {
return marker;
}
@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(jobId());
hashCode = 31 * hashCode + Objects.hashCode(serviceNamespace());
hashCode = 31 * hashCode + Objects.hashCode(maxItems());
hashCode = 31 * hashCode + Objects.hashCode(marker());
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 GetServiceLastAccessedDetailsWithEntitiesRequest)) {
return false;
}
GetServiceLastAccessedDetailsWithEntitiesRequest other = (GetServiceLastAccessedDetailsWithEntitiesRequest) obj;
return Objects.equals(jobId(), other.jobId()) && Objects.equals(serviceNamespace(), other.serviceNamespace())
&& Objects.equals(maxItems(), other.maxItems()) && Objects.equals(marker(), other.marker());
}
/**
* 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("GetServiceLastAccessedDetailsWithEntitiesRequest").add("JobId", jobId())
.add("ServiceNamespace", serviceNamespace()).add("MaxItems", maxItems()).add("Marker", marker()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "JobId":
return Optional.ofNullable(clazz.cast(jobId()));
case "ServiceNamespace":
return Optional.ofNullable(clazz.cast(serviceNamespace()));
case "MaxItems":
return Optional.ofNullable(clazz.cast(maxItems()));
case "Marker":
return Optional.ofNullable(clazz.cast(marker()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function