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

software.amazon.awssdk.services.iotanalytics.model.ChannelStorageSummary 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.iotanalytics.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;

/**
 * 

* Where channel data is stored. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ChannelStorageSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField SERVICE_MANAGED_S3_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("serviceManagedS3") .getter(getter(ChannelStorageSummary::serviceManagedS3)).setter(setter(Builder::serviceManagedS3)) .constructor(ServiceManagedChannelS3StorageSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceManagedS3").build()).build(); private static final SdkField CUSTOMER_MANAGED_S3_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("customerManagedS3") .getter(getter(ChannelStorageSummary::customerManagedS3)).setter(setter(Builder::customerManagedS3)) .constructor(CustomerManagedChannelS3StorageSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("customerManagedS3").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SERVICE_MANAGED_S3_FIELD, CUSTOMER_MANAGED_S3_FIELD)); private static final long serialVersionUID = 1L; private final ServiceManagedChannelS3StorageSummary serviceManagedS3; private final CustomerManagedChannelS3StorageSummary customerManagedS3; private ChannelStorageSummary(BuilderImpl builder) { this.serviceManagedS3 = builder.serviceManagedS3; this.customerManagedS3 = builder.customerManagedS3; } /** *

* Used to store channel data in an S3 bucket managed by IoT Analytics. *

* * @return Used to store channel data in an S3 bucket managed by IoT Analytics. */ public final ServiceManagedChannelS3StorageSummary serviceManagedS3() { return serviceManagedS3; } /** *

* Used to store channel data in an S3 bucket that you manage. *

* * @return Used to store channel data in an S3 bucket that you manage. */ public final CustomerManagedChannelS3StorageSummary customerManagedS3() { return customerManagedS3; } @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(serviceManagedS3()); hashCode = 31 * hashCode + Objects.hashCode(customerManagedS3()); 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 ChannelStorageSummary)) { return false; } ChannelStorageSummary other = (ChannelStorageSummary) obj; return Objects.equals(serviceManagedS3(), other.serviceManagedS3()) && Objects.equals(customerManagedS3(), other.customerManagedS3()); } /** * 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("ChannelStorageSummary").add("ServiceManagedS3", serviceManagedS3()) .add("CustomerManagedS3", customerManagedS3()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "serviceManagedS3": return Optional.ofNullable(clazz.cast(serviceManagedS3())); case "customerManagedS3": return Optional.ofNullable(clazz.cast(customerManagedS3())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ChannelStorageSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Used to store channel data in an S3 bucket managed by IoT Analytics. *

* * @param serviceManagedS3 * Used to store channel data in an S3 bucket managed by IoT Analytics. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceManagedS3(ServiceManagedChannelS3StorageSummary serviceManagedS3); /** *

* Used to store channel data in an S3 bucket managed by IoT Analytics. *

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

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

* Used to store channel data in an S3 bucket that you manage. *

* * @param customerManagedS3 * Used to store channel data in an S3 bucket that you manage. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customerManagedS3(CustomerManagedChannelS3StorageSummary customerManagedS3); /** *

* Used to store channel data in an S3 bucket that you manage. *

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

* When the {@link Consumer} completes, {@link CustomerManagedChannelS3StorageSummary.Builder#build()} is called * immediately and its result is passed to {@link #customerManagedS3(CustomerManagedChannelS3StorageSummary)}. * * @param customerManagedS3 * a consumer that will call methods on {@link CustomerManagedChannelS3StorageSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #customerManagedS3(CustomerManagedChannelS3StorageSummary) */ default Builder customerManagedS3(Consumer customerManagedS3) { return customerManagedS3(CustomerManagedChannelS3StorageSummary.builder().applyMutation(customerManagedS3).build()); } } static final class BuilderImpl implements Builder { private ServiceManagedChannelS3StorageSummary serviceManagedS3; private CustomerManagedChannelS3StorageSummary customerManagedS3; private BuilderImpl() { } private BuilderImpl(ChannelStorageSummary model) { serviceManagedS3(model.serviceManagedS3); customerManagedS3(model.customerManagedS3); } public final ServiceManagedChannelS3StorageSummary.Builder getServiceManagedS3() { return serviceManagedS3 != null ? serviceManagedS3.toBuilder() : null; } public final void setServiceManagedS3(ServiceManagedChannelS3StorageSummary.BuilderImpl serviceManagedS3) { this.serviceManagedS3 = serviceManagedS3 != null ? serviceManagedS3.build() : null; } @Override public final Builder serviceManagedS3(ServiceManagedChannelS3StorageSummary serviceManagedS3) { this.serviceManagedS3 = serviceManagedS3; return this; } public final CustomerManagedChannelS3StorageSummary.Builder getCustomerManagedS3() { return customerManagedS3 != null ? customerManagedS3.toBuilder() : null; } public final void setCustomerManagedS3(CustomerManagedChannelS3StorageSummary.BuilderImpl customerManagedS3) { this.customerManagedS3 = customerManagedS3 != null ? customerManagedS3.build() : null; } @Override public final Builder customerManagedS3(CustomerManagedChannelS3StorageSummary customerManagedS3) { this.customerManagedS3 = customerManagedS3; return this; } @Override public ChannelStorageSummary build() { return new ChannelStorageSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy