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

software.amazon.awssdk.services.tnb.model.PutSolFunctionPackageContentRequest Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.39
Show 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.tnb.model;

import java.nio.ByteBuffer;
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.SdkBytes;
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.PayloadTrait;
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 PutSolFunctionPackageContentRequest extends TnbRequest implements
        ToCopyableBuilder {
    private static final SdkField CONTENT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("contentType").getter(getter(PutSolFunctionPackageContentRequest::contentTypeAsString))
            .setter(setter(Builder::contentType))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("Content-Type").build()).build();

    private static final SdkField FILE_FIELD = SdkField
            . builder(MarshallingType.SDK_BYTES)
            .memberName("file")
            .getter(getter(PutSolFunctionPackageContentRequest::file))
            .setter(setter(Builder::file))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("file").build(),
                    PayloadTrait.create()).build();

    private static final SdkField VNF_PKG_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("vnfPkgId").getter(getter(PutSolFunctionPackageContentRequest::vnfPkgId))
            .setter(setter(Builder::vnfPkgId))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("vnfPkgId").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CONTENT_TYPE_FIELD,
            FILE_FIELD, VNF_PKG_ID_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();

    private final String contentType;

    private final SdkBytes file;

    private final String vnfPkgId;

    private PutSolFunctionPackageContentRequest(BuilderImpl builder) {
        super(builder);
        this.contentType = builder.contentType;
        this.file = builder.file;
        this.vnfPkgId = builder.vnfPkgId;
    }

    /**
     * 

* Function package content type. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #contentType} will * return {@link PackageContentType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #contentTypeAsString}. *

* * @return Function package content type. * @see PackageContentType */ public final PackageContentType contentType() { return PackageContentType.fromValue(contentType); } /** *

* Function package content type. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #contentType} will * return {@link PackageContentType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #contentTypeAsString}. *

* * @return Function package content type. * @see PackageContentType */ public final String contentTypeAsString() { return contentType; } /** *

* Function package file. *

* * @return Function package file. */ public final SdkBytes file() { return file; } /** *

* Function package ID. *

* * @return Function package ID. */ public final String vnfPkgId() { return vnfPkgId; } @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(contentTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(file()); hashCode = 31 * hashCode + Objects.hashCode(vnfPkgId()); 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 PutSolFunctionPackageContentRequest)) { return false; } PutSolFunctionPackageContentRequest other = (PutSolFunctionPackageContentRequest) obj; return Objects.equals(contentTypeAsString(), other.contentTypeAsString()) && Objects.equals(file(), other.file()) && Objects.equals(vnfPkgId(), other.vnfPkgId()); } /** * 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("PutSolFunctionPackageContentRequest").add("ContentType", contentTypeAsString()) .add("File", file() == null ? null : "*** Sensitive Data Redacted ***").add("VnfPkgId", vnfPkgId()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "contentType": return Optional.ofNullable(clazz.cast(contentTypeAsString())); case "file": return Optional.ofNullable(clazz.cast(file())); case "vnfPkgId": return Optional.ofNullable(clazz.cast(vnfPkgId())); 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("Content-Type", CONTENT_TYPE_FIELD); map.put("file", FILE_FIELD); map.put("vnfPkgId", VNF_PKG_ID_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((PutSolFunctionPackageContentRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends TnbRequest.Builder, SdkPojo, CopyableBuilder { /** *

* Function package content type. *

* * @param contentType * Function package content type. * @see PackageContentType * @return Returns a reference to this object so that method calls can be chained together. * @see PackageContentType */ Builder contentType(String contentType); /** *

* Function package content type. *

* * @param contentType * Function package content type. * @see PackageContentType * @return Returns a reference to this object so that method calls can be chained together. * @see PackageContentType */ Builder contentType(PackageContentType contentType); /** *

* Function package file. *

* * @param file * Function package file. * @return Returns a reference to this object so that method calls can be chained together. */ Builder file(SdkBytes file); /** *

* Function package ID. *

* * @param vnfPkgId * Function package ID. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vnfPkgId(String vnfPkgId); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends TnbRequest.BuilderImpl implements Builder { private String contentType; private SdkBytes file; private String vnfPkgId; private BuilderImpl() { } private BuilderImpl(PutSolFunctionPackageContentRequest model) { super(model); contentType(model.contentType); file(model.file); vnfPkgId(model.vnfPkgId); } public final String getContentType() { return contentType; } public final void setContentType(String contentType) { this.contentType = contentType; } @Override public final Builder contentType(String contentType) { this.contentType = contentType; return this; } @Override public final Builder contentType(PackageContentType contentType) { this.contentType(contentType == null ? null : contentType.toString()); return this; } public final ByteBuffer getFile() { return file == null ? null : file.asByteBuffer(); } public final void setFile(ByteBuffer file) { file(file == null ? null : SdkBytes.fromByteBuffer(file)); } @Override public final Builder file(SdkBytes file) { this.file = file; return this; } public final String getVnfPkgId() { return vnfPkgId; } public final void setVnfPkgId(String vnfPkgId) { this.vnfPkgId = vnfPkgId; } @Override public final Builder vnfPkgId(String vnfPkgId) { this.vnfPkgId = vnfPkgId; 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 PutSolFunctionPackageContentRequest build() { return new PutSolFunctionPackageContentRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy