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

software.amazon.awssdk.services.transfer.model.UpdateAgreementRequest 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.transfer.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 UpdateAgreementRequest extends TransferRequest implements
        ToCopyableBuilder {
    private static final SdkField AGREEMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("AgreementId").getter(getter(UpdateAgreementRequest::agreementId)).setter(setter(Builder::agreementId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AgreementId").build()).build();

    private static final SdkField SERVER_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ServerId").getter(getter(UpdateAgreementRequest::serverId)).setter(setter(Builder::serverId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServerId").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Description").getter(getter(UpdateAgreementRequest::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();

    private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
            .getter(getter(UpdateAgreementRequest::statusAsString)).setter(setter(Builder::status))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();

    private static final SdkField LOCAL_PROFILE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("LocalProfileId").getter(getter(UpdateAgreementRequest::localProfileId))
            .setter(setter(Builder::localProfileId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocalProfileId").build()).build();

    private static final SdkField PARTNER_PROFILE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("PartnerProfileId").getter(getter(UpdateAgreementRequest::partnerProfileId))
            .setter(setter(Builder::partnerProfileId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PartnerProfileId").build()).build();

    private static final SdkField BASE_DIRECTORY_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("BaseDirectory").getter(getter(UpdateAgreementRequest::baseDirectory))
            .setter(setter(Builder::baseDirectory))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BaseDirectory").build()).build();

    private static final SdkField ACCESS_ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("AccessRole").getter(getter(UpdateAgreementRequest::accessRole)).setter(setter(Builder::accessRole))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccessRole").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AGREEMENT_ID_FIELD,
            SERVER_ID_FIELD, DESCRIPTION_FIELD, STATUS_FIELD, LOCAL_PROFILE_ID_FIELD, PARTNER_PROFILE_ID_FIELD,
            BASE_DIRECTORY_FIELD, ACCESS_ROLE_FIELD));

    private final String agreementId;

    private final String serverId;

    private final String description;

    private final String status;

    private final String localProfileId;

    private final String partnerProfileId;

    private final String baseDirectory;

    private final String accessRole;

    private UpdateAgreementRequest(BuilderImpl builder) {
        super(builder);
        this.agreementId = builder.agreementId;
        this.serverId = builder.serverId;
        this.description = builder.description;
        this.status = builder.status;
        this.localProfileId = builder.localProfileId;
        this.partnerProfileId = builder.partnerProfileId;
        this.baseDirectory = builder.baseDirectory;
        this.accessRole = builder.accessRole;
    }

    /**
     * 

* A unique identifier for the agreement. This identifier is returned when you create an agreement. *

* * @return A unique identifier for the agreement. This identifier is returned when you create an agreement. */ public final String agreementId() { return agreementId; } /** *

* A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses. *

* * @return A system-assigned unique identifier for a server instance. This is the specific server that the agreement * uses. */ public final String serverId() { return serverId; } /** *

* To replace the existing description, provide a short description for the agreement. *

* * @return To replace the existing description, provide a short description for the agreement. */ public final String description() { return description; } /** *

* You can update the status for the agreement, either activating an inactive agreement or the reverse. *

*

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

* * @return You can update the status for the agreement, either activating an inactive agreement or the reverse. * @see AgreementStatusType */ public final AgreementStatusType status() { return AgreementStatusType.fromValue(status); } /** *

* You can update the status for the agreement, either activating an inactive agreement or the reverse. *

*

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

* * @return You can update the status for the agreement, either activating an inactive agreement or the reverse. * @see AgreementStatusType */ public final String statusAsString() { return status; } /** *

* A unique identifier for the AS2 local profile. *

*

* To change the local profile identifier, provide a new value here. *

* * @return A unique identifier for the AS2 local profile.

*

* To change the local profile identifier, provide a new value here. */ public final String localProfileId() { return localProfileId; } /** *

* A unique identifier for the partner profile. To change the partner profile identifier, provide a new value here. *

* * @return A unique identifier for the partner profile. To change the partner profile identifier, provide a new * value here. */ public final String partnerProfileId() { return partnerProfileId; } /** *

* To change the landing directory (folder) for files that are transferred, provide the bucket folder that you want * to use; for example, /DOC-EXAMPLE-BUCKET/home/mydirectory . *

* * @return To change the landing directory (folder) for files that are transferred, provide the bucket folder that * you want to use; for example, /DOC-EXAMPLE-BUCKET/home/mydirectory . */ public final String baseDirectory() { return baseDirectory; } /** *

* With AS2, you can send files by calling StartFileTransfer and specifying the file paths in the * request parameter, SendFilePaths. We use the file’s parent directory (for example, for * --send-file-paths /bucket/dir/file.txt, parent directory is /bucket/dir/) to * temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a * final JSON file containing relevant metadata of the transmission. So, the AccessRole needs to * provide read and write access to the parent directory of the file location used in the * StartFileTransfer request. Additionally, you need to provide read and write access to the parent * directory of the files that you intend to send with StartFileTransfer. *

* * @return With AS2, you can send files by calling StartFileTransfer and specifying the file paths in * the request parameter, SendFilePaths. We use the file’s parent directory (for example, for * --send-file-paths /bucket/dir/file.txt, parent directory is /bucket/dir/) to * temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and * write a final JSON file containing relevant metadata of the transmission. So, the AccessRole * needs to provide read and write access to the parent directory of the file location used in the * StartFileTransfer request. Additionally, you need to provide read and write access to the * parent directory of the files that you intend to send with StartFileTransfer. */ public final String accessRole() { return accessRole; } @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(agreementId()); hashCode = 31 * hashCode + Objects.hashCode(serverId()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(localProfileId()); hashCode = 31 * hashCode + Objects.hashCode(partnerProfileId()); hashCode = 31 * hashCode + Objects.hashCode(baseDirectory()); hashCode = 31 * hashCode + Objects.hashCode(accessRole()); 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 UpdateAgreementRequest)) { return false; } UpdateAgreementRequest other = (UpdateAgreementRequest) obj; return Objects.equals(agreementId(), other.agreementId()) && Objects.equals(serverId(), other.serverId()) && Objects.equals(description(), other.description()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(localProfileId(), other.localProfileId()) && Objects.equals(partnerProfileId(), other.partnerProfileId()) && Objects.equals(baseDirectory(), other.baseDirectory()) && Objects.equals(accessRole(), other.accessRole()); } /** * 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("UpdateAgreementRequest").add("AgreementId", agreementId()).add("ServerId", serverId()) .add("Description", description()).add("Status", statusAsString()).add("LocalProfileId", localProfileId()) .add("PartnerProfileId", partnerProfileId()).add("BaseDirectory", baseDirectory()) .add("AccessRole", accessRole()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AgreementId": return Optional.ofNullable(clazz.cast(agreementId())); case "ServerId": return Optional.ofNullable(clazz.cast(serverId())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "LocalProfileId": return Optional.ofNullable(clazz.cast(localProfileId())); case "PartnerProfileId": return Optional.ofNullable(clazz.cast(partnerProfileId())); case "BaseDirectory": return Optional.ofNullable(clazz.cast(baseDirectory())); case "AccessRole": return Optional.ofNullable(clazz.cast(accessRole())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateAgreementRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends TransferRequest.Builder, SdkPojo, CopyableBuilder { /** *

* A unique identifier for the agreement. This identifier is returned when you create an agreement. *

* * @param agreementId * A unique identifier for the agreement. This identifier is returned when you create an agreement. * @return Returns a reference to this object so that method calls can be chained together. */ Builder agreementId(String agreementId); /** *

* A system-assigned unique identifier for a server instance. This is the specific server that the agreement * uses. *

* * @param serverId * A system-assigned unique identifier for a server instance. This is the specific server that the * agreement uses. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serverId(String serverId); /** *

* To replace the existing description, provide a short description for the agreement. *

* * @param description * To replace the existing description, provide a short description for the agreement. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* You can update the status for the agreement, either activating an inactive agreement or the reverse. *

* * @param status * You can update the status for the agreement, either activating an inactive agreement or the reverse. * @see AgreementStatusType * @return Returns a reference to this object so that method calls can be chained together. * @see AgreementStatusType */ Builder status(String status); /** *

* You can update the status for the agreement, either activating an inactive agreement or the reverse. *

* * @param status * You can update the status for the agreement, either activating an inactive agreement or the reverse. * @see AgreementStatusType * @return Returns a reference to this object so that method calls can be chained together. * @see AgreementStatusType */ Builder status(AgreementStatusType status); /** *

* A unique identifier for the AS2 local profile. *

*

* To change the local profile identifier, provide a new value here. *

* * @param localProfileId * A unique identifier for the AS2 local profile.

*

* To change the local profile identifier, provide a new value here. * @return Returns a reference to this object so that method calls can be chained together. */ Builder localProfileId(String localProfileId); /** *

* A unique identifier for the partner profile. To change the partner profile identifier, provide a new value * here. *

* * @param partnerProfileId * A unique identifier for the partner profile. To change the partner profile identifier, provide a new * value here. * @return Returns a reference to this object so that method calls can be chained together. */ Builder partnerProfileId(String partnerProfileId); /** *

* To change the landing directory (folder) for files that are transferred, provide the bucket folder that you * want to use; for example, /DOC-EXAMPLE-BUCKET/home/mydirectory . *

* * @param baseDirectory * To change the landing directory (folder) for files that are transferred, provide the bucket folder * that you want to use; for example, * /DOC-EXAMPLE-BUCKET/home/mydirectory . * @return Returns a reference to this object so that method calls can be chained together. */ Builder baseDirectory(String baseDirectory); /** *

* With AS2, you can send files by calling StartFileTransfer and specifying the file paths in the * request parameter, SendFilePaths. We use the file’s parent directory (for example, for * --send-file-paths /bucket/dir/file.txt, parent directory is /bucket/dir/) to * temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and * write a final JSON file containing relevant metadata of the transmission. So, the AccessRole * needs to provide read and write access to the parent directory of the file location used in the * StartFileTransfer request. Additionally, you need to provide read and write access to the parent * directory of the files that you intend to send with StartFileTransfer. *

* * @param accessRole * With AS2, you can send files by calling StartFileTransfer and specifying the file paths * in the request parameter, SendFilePaths. We use the file’s parent directory (for example, * for --send-file-paths /bucket/dir/file.txt, parent directory is /bucket/dir/ * ) to temporarily store a processed AS2 message file, store the MDN when we receive them from the * partner, and write a final JSON file containing relevant metadata of the transmission. So, the * AccessRole needs to provide read and write access to the parent directory of the file * location used in the StartFileTransfer request. Additionally, you need to provide read * and write access to the parent directory of the files that you intend to send with * StartFileTransfer. * @return Returns a reference to this object so that method calls can be chained together. */ Builder accessRole(String accessRole); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends TransferRequest.BuilderImpl implements Builder { private String agreementId; private String serverId; private String description; private String status; private String localProfileId; private String partnerProfileId; private String baseDirectory; private String accessRole; private BuilderImpl() { } private BuilderImpl(UpdateAgreementRequest model) { super(model); agreementId(model.agreementId); serverId(model.serverId); description(model.description); status(model.status); localProfileId(model.localProfileId); partnerProfileId(model.partnerProfileId); baseDirectory(model.baseDirectory); accessRole(model.accessRole); } public final String getAgreementId() { return agreementId; } public final void setAgreementId(String agreementId) { this.agreementId = agreementId; } @Override public final Builder agreementId(String agreementId) { this.agreementId = agreementId; return this; } public final String getServerId() { return serverId; } public final void setServerId(String serverId) { this.serverId = serverId; } @Override public final Builder serverId(String serverId) { this.serverId = serverId; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(AgreementStatusType status) { this.status(status == null ? null : status.toString()); return this; } public final String getLocalProfileId() { return localProfileId; } public final void setLocalProfileId(String localProfileId) { this.localProfileId = localProfileId; } @Override public final Builder localProfileId(String localProfileId) { this.localProfileId = localProfileId; return this; } public final String getPartnerProfileId() { return partnerProfileId; } public final void setPartnerProfileId(String partnerProfileId) { this.partnerProfileId = partnerProfileId; } @Override public final Builder partnerProfileId(String partnerProfileId) { this.partnerProfileId = partnerProfileId; return this; } public final String getBaseDirectory() { return baseDirectory; } public final void setBaseDirectory(String baseDirectory) { this.baseDirectory = baseDirectory; } @Override public final Builder baseDirectory(String baseDirectory) { this.baseDirectory = baseDirectory; return this; } public final String getAccessRole() { return accessRole; } public final void setAccessRole(String accessRole) { this.accessRole = accessRole; } @Override public final Builder accessRole(String accessRole) { this.accessRole = accessRole; 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 UpdateAgreementRequest build() { return new UpdateAgreementRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy