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

software.amazon.awssdk.services.applicationsignals.model.ListServiceDependentsRequest Maven / Gradle / Ivy

/*
 * 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.applicationsignals.model;

import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
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 ListServiceDependentsRequest extends ApplicationSignalsRequest implements
        ToCopyableBuilder {
    private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("StartTime").getter(getter(ListServiceDependentsRequest::startTime)).setter(setter(Builder::startTime))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("StartTime").build()).build();

    private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("EndTime").getter(getter(ListServiceDependentsRequest::endTime)).setter(setter(Builder::endTime))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("EndTime").build()).build();

    private static final SdkField> KEY_ATTRIBUTES_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("KeyAttributes")
            .getter(getter(ListServiceDependentsRequest::keyAttributes))
            .setter(setter(Builder::keyAttributes))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeyAttributes").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField MAX_RESULTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("MaxResults").getter(getter(ListServiceDependentsRequest::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(ListServiceDependentsRequest::nextToken)).setter(setter(Builder::nextToken))
            .traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("NextToken").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(START_TIME_FIELD,
            END_TIME_FIELD, KEY_ATTRIBUTES_FIELD, MAX_RESULTS_FIELD, NEXT_TOKEN_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();

    private final Instant startTime;

    private final Instant endTime;

    private final Map keyAttributes;

    private final Integer maxResults;

    private final String nextToken;

    private ListServiceDependentsRequest(BuilderImpl builder) {
        super(builder);
        this.startTime = builder.startTime;
        this.endTime = builder.endTime;
        this.keyAttributes = builder.keyAttributes;
        this.maxResults = builder.maxResults;
        this.nextToken = builder.nextToken;
    }

    /**
     * 

* The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as * be epoch time in seconds. For example: 1698778057 *

*

* Your requested start time will be rounded to the nearest hour. *

* * @return The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is * formatted as be epoch time in seconds. For example: 1698778057

*

* Your requested start time will be rounded to the nearest hour. */ public final Instant startTime() { return startTime; } /** *

* The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as * be epoch time in seconds. For example: 1698778057 *

*

* Your requested start time will be rounded to the nearest hour. *

* * @return The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is * formatted as be epoch time in seconds. For example: 1698778057

*

* Your requested start time will be rounded to the nearest hour. */ public final Instant endTime() { return endTime; } /** * For responses, this returns true if the service returned a value for the KeyAttributes property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasKeyAttributes() { return keyAttributes != null && !(keyAttributes instanceof SdkAutoConstructMap); } /** *

* Use this field to specify which service you want to retrieve information for. You must specify at least the * Type, Name, and Environment attributes. *

*

* This is a string-to-string map. It can include the following fields. *

*
    *
  • *

    * Type designates the type of object this is. *

    *
  • *
  • *

    * ResourceType specifies the type of the resource. This field is used only when the value of the * Type field is Resource or AWS::Resource. *

    *
  • *
  • *

    * Name specifies the name of the object. This is used only if the value of the Type field * is Service, RemoteService, or AWS::Service. *

    *
  • *
  • *

    * Identifier identifies the resource objects of this resource. This is used only if the value of the * Type field is Resource or AWS::Resource. *

    *
  • *
  • *

    * Environment specifies the location where this object is hosted, or what it belongs to. *

    *
  • *
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasKeyAttributes} method. *

* * @return Use this field to specify which service you want to retrieve information for. You must specify at least * the Type, Name, and Environment attributes.

*

* This is a string-to-string map. It can include the following fields. *

*
    *
  • *

    * Type designates the type of object this is. *

    *
  • *
  • *

    * ResourceType specifies the type of the resource. This field is used only when the value of * the Type field is Resource or AWS::Resource. *

    *
  • *
  • *

    * Name specifies the name of the object. This is used only if the value of the * Type field is Service, RemoteService, or AWS::Service * . *

    *
  • *
  • *

    * Identifier identifies the resource objects of this resource. This is used only if the value * of the Type field is Resource or AWS::Resource. *

    *
  • *
  • *

    * Environment specifies the location where this object is hosted, or what it belongs to. *

    *
  • */ public final Map keyAttributes() { return keyAttributes; } /** *

    * The maximum number of results to return in one operation. If you omit this parameter, the default of 50 is used. *

    * * @return The maximum number of results to return in one operation. If you omit this parameter, the default of 50 * is used. */ public final Integer maxResults() { return maxResults; } /** *

    * Include this value, if it was returned by the previous operation, to get the next set of service dependents. *

    * * @return Include this value, if it was returned by the previous operation, to get the next set of service * dependents. */ public final String nextToken() { return nextToken; } @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(startTime()); hashCode = 31 * hashCode + Objects.hashCode(endTime()); hashCode = 31 * hashCode + Objects.hashCode(hasKeyAttributes() ? keyAttributes() : null); hashCode = 31 * hashCode + Objects.hashCode(maxResults()); hashCode = 31 * hashCode + Objects.hashCode(nextToken()); 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 ListServiceDependentsRequest)) { return false; } ListServiceDependentsRequest other = (ListServiceDependentsRequest) obj; return Objects.equals(startTime(), other.startTime()) && Objects.equals(endTime(), other.endTime()) && hasKeyAttributes() == other.hasKeyAttributes() && Objects.equals(keyAttributes(), other.keyAttributes()) && Objects.equals(maxResults(), other.maxResults()) && Objects.equals(nextToken(), other.nextToken()); } /** * 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("ListServiceDependentsRequest").add("StartTime", startTime()).add("EndTime", endTime()) .add("KeyAttributes", hasKeyAttributes() ? keyAttributes() : null).add("MaxResults", maxResults()) .add("NextToken", nextToken()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "EndTime": return Optional.ofNullable(clazz.cast(endTime())); case "KeyAttributes": return Optional.ofNullable(clazz.cast(keyAttributes())); case "MaxResults": return Optional.ofNullable(clazz.cast(maxResults())); case "NextToken": return Optional.ofNullable(clazz.cast(nextToken())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("StartTime", START_TIME_FIELD); map.put("EndTime", END_TIME_FIELD); map.put("KeyAttributes", KEY_ATTRIBUTES_FIELD); map.put("MaxResults", MAX_RESULTS_FIELD); map.put("NextToken", NEXT_TOKEN_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((ListServiceDependentsRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends ApplicationSignalsRequest.Builder, SdkPojo, CopyableBuilder { /** *

    * The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is * formatted as be epoch time in seconds. For example: 1698778057 *

    *

    * Your requested start time will be rounded to the nearest hour. *

    * * @param startTime * The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is * formatted as be epoch time in seconds. For example: 1698778057

    *

    * Your requested start time will be rounded to the nearest hour. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

    * The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted * as be epoch time in seconds. For example: 1698778057 *

    *

    * Your requested start time will be rounded to the nearest hour. *

    * * @param endTime * The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is * formatted as be epoch time in seconds. For example: 1698778057

    *

    * Your requested start time will be rounded to the nearest hour. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endTime(Instant endTime); /** *

    * Use this field to specify which service you want to retrieve information for. You must specify at least the * Type, Name, and Environment attributes. *

    *

    * This is a string-to-string map. It can include the following fields. *

    *
      *
    • *

      * Type designates the type of object this is. *

      *
    • *
    • *

      * ResourceType specifies the type of the resource. This field is used only when the value of the * Type field is Resource or AWS::Resource. *

      *
    • *
    • *

      * Name specifies the name of the object. This is used only if the value of the Type * field is Service, RemoteService, or AWS::Service. *

      *
    • *
    • *

      * Identifier identifies the resource objects of this resource. This is used only if the value of * the Type field is Resource or AWS::Resource. *

      *
    • *
    • *

      * Environment specifies the location where this object is hosted, or what it belongs to. *

      *
    • *
    * * @param keyAttributes * Use this field to specify which service you want to retrieve information for. You must specify at * least the Type, Name, and Environment attributes.

    *

    * This is a string-to-string map. It can include the following fields. *

    *
      *
    • *

      * Type designates the type of object this is. *

      *
    • *
    • *

      * ResourceType specifies the type of the resource. This field is used only when the value * of the Type field is Resource or AWS::Resource. *

      *
    • *
    • *

      * Name specifies the name of the object. This is used only if the value of the * Type field is Service, RemoteService, or * AWS::Service. *

      *
    • *
    • *

      * Identifier identifies the resource objects of this resource. This is used only if the * value of the Type field is Resource or AWS::Resource. *

      *
    • *
    • *

      * Environment specifies the location where this object is hosted, or what it belongs to. *

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

      * The maximum number of results to return in one operation. If you omit this parameter, the default of 50 is * used. *

      * * @param maxResults * The maximum number of results to return in one operation. If you omit this parameter, the default of * 50 is used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxResults(Integer maxResults); /** *

      * Include this value, if it was returned by the previous operation, to get the next set of service dependents. *

      * * @param nextToken * Include this value, if it was returned by the previous operation, to get the next set of service * dependents. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nextToken(String nextToken); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends ApplicationSignalsRequest.BuilderImpl implements Builder { private Instant startTime; private Instant endTime; private Map keyAttributes = DefaultSdkAutoConstructMap.getInstance(); private Integer maxResults; private String nextToken; private BuilderImpl() { } private BuilderImpl(ListServiceDependentsRequest model) { super(model); startTime(model.startTime); endTime(model.endTime); keyAttributes(model.keyAttributes); maxResults(model.maxResults); nextToken(model.nextToken); } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final Instant getEndTime() { return endTime; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override public final Builder endTime(Instant endTime) { this.endTime = endTime; return this; } public final Map getKeyAttributes() { if (keyAttributes instanceof SdkAutoConstructMap) { return null; } return keyAttributes; } public final void setKeyAttributes(Map keyAttributes) { this.keyAttributes = AttributesCopier.copy(keyAttributes); } @Override public final Builder keyAttributes(Map keyAttributes) { this.keyAttributes = AttributesCopier.copy(keyAttributes); return this; } public final Integer getMaxResults() { return maxResults; } public final void setMaxResults(Integer maxResults) { this.maxResults = maxResults; } @Override public final Builder maxResults(Integer maxResults) { this.maxResults = maxResults; return this; } public final String getNextToken() { return nextToken; } public final void setNextToken(String nextToken) { this.nextToken = nextToken; } @Override public final Builder nextToken(String nextToken) { this.nextToken = nextToken; 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 ListServiceDependentsRequest build() { return new ListServiceDependentsRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy