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

software.amazon.awssdk.services.proton.model.CountsSummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Proton module holds the client classes that are used for communicating with Proton.

The 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.proton.model;

import java.io.Serializable;
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.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;

/**
 * 

* Summary counts of each Proton resource type. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CountsSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField COMPONENTS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("components") .getter(getter(CountsSummary::components)).setter(setter(Builder::components)) .constructor(ResourceCountsSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("components").build()).build(); private static final SdkField ENVIRONMENT_TEMPLATES_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("environmentTemplates") .getter(getter(CountsSummary::environmentTemplates)).setter(setter(Builder::environmentTemplates)) .constructor(ResourceCountsSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("environmentTemplates").build()) .build(); private static final SdkField ENVIRONMENTS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("environments") .getter(getter(CountsSummary::environments)).setter(setter(Builder::environments)) .constructor(ResourceCountsSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("environments").build()).build(); private static final SdkField PIPELINES_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("pipelines") .getter(getter(CountsSummary::pipelines)).setter(setter(Builder::pipelines)) .constructor(ResourceCountsSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pipelines").build()).build(); private static final SdkField SERVICE_INSTANCES_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("serviceInstances") .getter(getter(CountsSummary::serviceInstances)).setter(setter(Builder::serviceInstances)) .constructor(ResourceCountsSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceInstances").build()).build(); private static final SdkField SERVICE_TEMPLATES_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("serviceTemplates") .getter(getter(CountsSummary::serviceTemplates)).setter(setter(Builder::serviceTemplates)) .constructor(ResourceCountsSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceTemplates").build()).build(); private static final SdkField SERVICES_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("services") .getter(getter(CountsSummary::services)).setter(setter(Builder::services)) .constructor(ResourceCountsSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("services").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(COMPONENTS_FIELD, ENVIRONMENT_TEMPLATES_FIELD, ENVIRONMENTS_FIELD, PIPELINES_FIELD, SERVICE_INSTANCES_FIELD, SERVICE_TEMPLATES_FIELD, SERVICES_FIELD)); private static final long serialVersionUID = 1L; private final ResourceCountsSummary components; private final ResourceCountsSummary environmentTemplates; private final ResourceCountsSummary environments; private final ResourceCountsSummary pipelines; private final ResourceCountsSummary serviceInstances; private final ResourceCountsSummary serviceTemplates; private final ResourceCountsSummary services; private CountsSummary(BuilderImpl builder) { this.components = builder.components; this.environmentTemplates = builder.environmentTemplates; this.environments = builder.environments; this.pipelines = builder.pipelines; this.serviceInstances = builder.serviceInstances; this.serviceTemplates = builder.serviceTemplates; this.services = builder.services; } /** *

* The total number of components in the Amazon Web Services account. *

*

* The semantics of the components field are different from the semantics of results for other * infrastructure-provisioning resources. That's because at this time components don't have associated templates, * therefore they don't have the concept of staleness. The components object will only contain * total and failed members. *

* * @return The total number of components in the Amazon Web Services account.

*

* The semantics of the components field are different from the semantics of results for other * infrastructure-provisioning resources. That's because at this time components don't have associated * templates, therefore they don't have the concept of staleness. The components object will * only contain total and failed members. */ public final ResourceCountsSummary components() { return components; } /** *

* The total number of environment templates in the Amazon Web Services account. The * environmentTemplates object will only contain total members. *

* * @return The total number of environment templates in the Amazon Web Services account. The * environmentTemplates object will only contain total members. */ public final ResourceCountsSummary environmentTemplates() { return environmentTemplates; } /** *

* The staleness counts for Proton environments in the Amazon Web Services account. The environments * object will only contain total members. *

* * @return The staleness counts for Proton environments in the Amazon Web Services account. The * environments object will only contain total members. */ public final ResourceCountsSummary environments() { return environments; } /** *

* The staleness counts for Proton pipelines in the Amazon Web Services account. *

* * @return The staleness counts for Proton pipelines in the Amazon Web Services account. */ public final ResourceCountsSummary pipelines() { return pipelines; } /** *

* The staleness counts for Proton service instances in the Amazon Web Services account. *

* * @return The staleness counts for Proton service instances in the Amazon Web Services account. */ public final ResourceCountsSummary serviceInstances() { return serviceInstances; } /** *

* The total number of service templates in the Amazon Web Services account. The serviceTemplates * object will only contain total members. *

* * @return The total number of service templates in the Amazon Web Services account. The * serviceTemplates object will only contain total members. */ public final ResourceCountsSummary serviceTemplates() { return serviceTemplates; } /** *

* The staleness counts for Proton services in the Amazon Web Services account. *

* * @return The staleness counts for Proton services in the Amazon Web Services account. */ public final ResourceCountsSummary services() { return services; } @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 + Objects.hashCode(components()); hashCode = 31 * hashCode + Objects.hashCode(environmentTemplates()); hashCode = 31 * hashCode + Objects.hashCode(environments()); hashCode = 31 * hashCode + Objects.hashCode(pipelines()); hashCode = 31 * hashCode + Objects.hashCode(serviceInstances()); hashCode = 31 * hashCode + Objects.hashCode(serviceTemplates()); hashCode = 31 * hashCode + Objects.hashCode(services()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CountsSummary)) { return false; } CountsSummary other = (CountsSummary) obj; return Objects.equals(components(), other.components()) && Objects.equals(environmentTemplates(), other.environmentTemplates()) && Objects.equals(environments(), other.environments()) && Objects.equals(pipelines(), other.pipelines()) && Objects.equals(serviceInstances(), other.serviceInstances()) && Objects.equals(serviceTemplates(), other.serviceTemplates()) && Objects.equals(services(), other.services()); } /** * 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("CountsSummary").add("Components", components()) .add("EnvironmentTemplates", environmentTemplates()).add("Environments", environments()) .add("Pipelines", pipelines()).add("ServiceInstances", serviceInstances()) .add("ServiceTemplates", serviceTemplates()).add("Services", services()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "components": return Optional.ofNullable(clazz.cast(components())); case "environmentTemplates": return Optional.ofNullable(clazz.cast(environmentTemplates())); case "environments": return Optional.ofNullable(clazz.cast(environments())); case "pipelines": return Optional.ofNullable(clazz.cast(pipelines())); case "serviceInstances": return Optional.ofNullable(clazz.cast(serviceInstances())); case "serviceTemplates": return Optional.ofNullable(clazz.cast(serviceTemplates())); case "services": return Optional.ofNullable(clazz.cast(services())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CountsSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The total number of components in the Amazon Web Services account. *

*

* The semantics of the components field are different from the semantics of results for other * infrastructure-provisioning resources. That's because at this time components don't have associated * templates, therefore they don't have the concept of staleness. The components object will only * contain total and failed members. *

* * @param components * The total number of components in the Amazon Web Services account.

*

* The semantics of the components field are different from the semantics of results for * other infrastructure-provisioning resources. That's because at this time components don't have * associated templates, therefore they don't have the concept of staleness. The components * object will only contain total and failed members. * @return Returns a reference to this object so that method calls can be chained together. */ Builder components(ResourceCountsSummary components); /** *

* The total number of components in the Amazon Web Services account. *

*

* The semantics of the components field are different from the semantics of results for other * infrastructure-provisioning resources. That's because at this time components don't have associated * templates, therefore they don't have the concept of staleness. The components object will only * contain total and failed members. *

* This is a convenience method that creates an instance of the {@link ResourceCountsSummary.Builder} avoiding * the need to create one manually via {@link ResourceCountsSummary#builder()}. * *

* When the {@link Consumer} completes, {@link ResourceCountsSummary.Builder#build()} is called immediately and * its result is passed to {@link #components(ResourceCountsSummary)}. * * @param components * a consumer that will call methods on {@link ResourceCountsSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #components(ResourceCountsSummary) */ default Builder components(Consumer components) { return components(ResourceCountsSummary.builder().applyMutation(components).build()); } /** *

* The total number of environment templates in the Amazon Web Services account. The * environmentTemplates object will only contain total members. *

* * @param environmentTemplates * The total number of environment templates in the Amazon Web Services account. The * environmentTemplates object will only contain total members. * @return Returns a reference to this object so that method calls can be chained together. */ Builder environmentTemplates(ResourceCountsSummary environmentTemplates); /** *

* The total number of environment templates in the Amazon Web Services account. The * environmentTemplates object will only contain total members. *

* This is a convenience method that creates an instance of the {@link ResourceCountsSummary.Builder} avoiding * the need to create one manually via {@link ResourceCountsSummary#builder()}. * *

* When the {@link Consumer} completes, {@link ResourceCountsSummary.Builder#build()} is called immediately and * its result is passed to {@link #environmentTemplates(ResourceCountsSummary)}. * * @param environmentTemplates * a consumer that will call methods on {@link ResourceCountsSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #environmentTemplates(ResourceCountsSummary) */ default Builder environmentTemplates(Consumer environmentTemplates) { return environmentTemplates(ResourceCountsSummary.builder().applyMutation(environmentTemplates).build()); } /** *

* The staleness counts for Proton environments in the Amazon Web Services account. The * environments object will only contain total members. *

* * @param environments * The staleness counts for Proton environments in the Amazon Web Services account. The * environments object will only contain total members. * @return Returns a reference to this object so that method calls can be chained together. */ Builder environments(ResourceCountsSummary environments); /** *

* The staleness counts for Proton environments in the Amazon Web Services account. The * environments object will only contain total members. *

* This is a convenience method that creates an instance of the {@link ResourceCountsSummary.Builder} avoiding * the need to create one manually via {@link ResourceCountsSummary#builder()}. * *

* When the {@link Consumer} completes, {@link ResourceCountsSummary.Builder#build()} is called immediately and * its result is passed to {@link #environments(ResourceCountsSummary)}. * * @param environments * a consumer that will call methods on {@link ResourceCountsSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #environments(ResourceCountsSummary) */ default Builder environments(Consumer environments) { return environments(ResourceCountsSummary.builder().applyMutation(environments).build()); } /** *

* The staleness counts for Proton pipelines in the Amazon Web Services account. *

* * @param pipelines * The staleness counts for Proton pipelines in the Amazon Web Services account. * @return Returns a reference to this object so that method calls can be chained together. */ Builder pipelines(ResourceCountsSummary pipelines); /** *

* The staleness counts for Proton pipelines in the Amazon Web Services account. *

* This is a convenience method that creates an instance of the {@link ResourceCountsSummary.Builder} avoiding * the need to create one manually via {@link ResourceCountsSummary#builder()}. * *

* When the {@link Consumer} completes, {@link ResourceCountsSummary.Builder#build()} is called immediately and * its result is passed to {@link #pipelines(ResourceCountsSummary)}. * * @param pipelines * a consumer that will call methods on {@link ResourceCountsSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #pipelines(ResourceCountsSummary) */ default Builder pipelines(Consumer pipelines) { return pipelines(ResourceCountsSummary.builder().applyMutation(pipelines).build()); } /** *

* The staleness counts for Proton service instances in the Amazon Web Services account. *

* * @param serviceInstances * The staleness counts for Proton service instances in the Amazon Web Services account. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceInstances(ResourceCountsSummary serviceInstances); /** *

* The staleness counts for Proton service instances in the Amazon Web Services account. *

* This is a convenience method that creates an instance of the {@link ResourceCountsSummary.Builder} avoiding * the need to create one manually via {@link ResourceCountsSummary#builder()}. * *

* When the {@link Consumer} completes, {@link ResourceCountsSummary.Builder#build()} is called immediately and * its result is passed to {@link #serviceInstances(ResourceCountsSummary)}. * * @param serviceInstances * a consumer that will call methods on {@link ResourceCountsSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #serviceInstances(ResourceCountsSummary) */ default Builder serviceInstances(Consumer serviceInstances) { return serviceInstances(ResourceCountsSummary.builder().applyMutation(serviceInstances).build()); } /** *

* The total number of service templates in the Amazon Web Services account. The serviceTemplates * object will only contain total members. *

* * @param serviceTemplates * The total number of service templates in the Amazon Web Services account. The * serviceTemplates object will only contain total members. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceTemplates(ResourceCountsSummary serviceTemplates); /** *

* The total number of service templates in the Amazon Web Services account. The serviceTemplates * object will only contain total members. *

* This is a convenience method that creates an instance of the {@link ResourceCountsSummary.Builder} avoiding * the need to create one manually via {@link ResourceCountsSummary#builder()}. * *

* When the {@link Consumer} completes, {@link ResourceCountsSummary.Builder#build()} is called immediately and * its result is passed to {@link #serviceTemplates(ResourceCountsSummary)}. * * @param serviceTemplates * a consumer that will call methods on {@link ResourceCountsSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #serviceTemplates(ResourceCountsSummary) */ default Builder serviceTemplates(Consumer serviceTemplates) { return serviceTemplates(ResourceCountsSummary.builder().applyMutation(serviceTemplates).build()); } /** *

* The staleness counts for Proton services in the Amazon Web Services account. *

* * @param services * The staleness counts for Proton services in the Amazon Web Services account. * @return Returns a reference to this object so that method calls can be chained together. */ Builder services(ResourceCountsSummary services); /** *

* The staleness counts for Proton services in the Amazon Web Services account. *

* This is a convenience method that creates an instance of the {@link ResourceCountsSummary.Builder} avoiding * the need to create one manually via {@link ResourceCountsSummary#builder()}. * *

* When the {@link Consumer} completes, {@link ResourceCountsSummary.Builder#build()} is called immediately and * its result is passed to {@link #services(ResourceCountsSummary)}. * * @param services * a consumer that will call methods on {@link ResourceCountsSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #services(ResourceCountsSummary) */ default Builder services(Consumer services) { return services(ResourceCountsSummary.builder().applyMutation(services).build()); } } static final class BuilderImpl implements Builder { private ResourceCountsSummary components; private ResourceCountsSummary environmentTemplates; private ResourceCountsSummary environments; private ResourceCountsSummary pipelines; private ResourceCountsSummary serviceInstances; private ResourceCountsSummary serviceTemplates; private ResourceCountsSummary services; private BuilderImpl() { } private BuilderImpl(CountsSummary model) { components(model.components); environmentTemplates(model.environmentTemplates); environments(model.environments); pipelines(model.pipelines); serviceInstances(model.serviceInstances); serviceTemplates(model.serviceTemplates); services(model.services); } public final ResourceCountsSummary.Builder getComponents() { return components != null ? components.toBuilder() : null; } public final void setComponents(ResourceCountsSummary.BuilderImpl components) { this.components = components != null ? components.build() : null; } @Override public final Builder components(ResourceCountsSummary components) { this.components = components; return this; } public final ResourceCountsSummary.Builder getEnvironmentTemplates() { return environmentTemplates != null ? environmentTemplates.toBuilder() : null; } public final void setEnvironmentTemplates(ResourceCountsSummary.BuilderImpl environmentTemplates) { this.environmentTemplates = environmentTemplates != null ? environmentTemplates.build() : null; } @Override public final Builder environmentTemplates(ResourceCountsSummary environmentTemplates) { this.environmentTemplates = environmentTemplates; return this; } public final ResourceCountsSummary.Builder getEnvironments() { return environments != null ? environments.toBuilder() : null; } public final void setEnvironments(ResourceCountsSummary.BuilderImpl environments) { this.environments = environments != null ? environments.build() : null; } @Override public final Builder environments(ResourceCountsSummary environments) { this.environments = environments; return this; } public final ResourceCountsSummary.Builder getPipelines() { return pipelines != null ? pipelines.toBuilder() : null; } public final void setPipelines(ResourceCountsSummary.BuilderImpl pipelines) { this.pipelines = pipelines != null ? pipelines.build() : null; } @Override public final Builder pipelines(ResourceCountsSummary pipelines) { this.pipelines = pipelines; return this; } public final ResourceCountsSummary.Builder getServiceInstances() { return serviceInstances != null ? serviceInstances.toBuilder() : null; } public final void setServiceInstances(ResourceCountsSummary.BuilderImpl serviceInstances) { this.serviceInstances = serviceInstances != null ? serviceInstances.build() : null; } @Override public final Builder serviceInstances(ResourceCountsSummary serviceInstances) { this.serviceInstances = serviceInstances; return this; } public final ResourceCountsSummary.Builder getServiceTemplates() { return serviceTemplates != null ? serviceTemplates.toBuilder() : null; } public final void setServiceTemplates(ResourceCountsSummary.BuilderImpl serviceTemplates) { this.serviceTemplates = serviceTemplates != null ? serviceTemplates.build() : null; } @Override public final Builder serviceTemplates(ResourceCountsSummary serviceTemplates) { this.serviceTemplates = serviceTemplates; return this; } public final ResourceCountsSummary.Builder getServices() { return services != null ? services.toBuilder() : null; } public final void setServices(ResourceCountsSummary.BuilderImpl services) { this.services = services != null ? services.build() : null; } @Override public final Builder services(ResourceCountsSummary services) { this.services = services; return this; } @Override public CountsSummary build() { return new CountsSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy