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

software.amazon.awssdk.services.codestarconnections.model.CreateSyncConfigurationRequest Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.30.1
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.codestarconnections.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 CreateSyncConfigurationRequest extends CodeStarConnectionsRequest implements
        ToCopyableBuilder {
    private static final SdkField BRANCH_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Branch")
            .getter(getter(CreateSyncConfigurationRequest::branch)).setter(setter(Builder::branch))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Branch").build()).build();

    private static final SdkField CONFIG_FILE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ConfigFile").getter(getter(CreateSyncConfigurationRequest::configFile))
            .setter(setter(Builder::configFile))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConfigFile").build()).build();

    private static final SdkField REPOSITORY_LINK_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("RepositoryLinkId").getter(getter(CreateSyncConfigurationRequest::repositoryLinkId))
            .setter(setter(Builder::repositoryLinkId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RepositoryLinkId").build()).build();

    private static final SdkField RESOURCE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ResourceName").getter(getter(CreateSyncConfigurationRequest::resourceName))
            .setter(setter(Builder::resourceName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceName").build()).build();

    private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("RoleArn").getter(getter(CreateSyncConfigurationRequest::roleArn)).setter(setter(Builder::roleArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").build()).build();

    private static final SdkField SYNC_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("SyncType").getter(getter(CreateSyncConfigurationRequest::syncTypeAsString))
            .setter(setter(Builder::syncType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SyncType").build()).build();

    private static final SdkField PUBLISH_DEPLOYMENT_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("PublishDeploymentStatus")
            .getter(getter(CreateSyncConfigurationRequest::publishDeploymentStatusAsString))
            .setter(setter(Builder::publishDeploymentStatus))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PublishDeploymentStatus").build())
            .build();

    private static final SdkField TRIGGER_RESOURCE_UPDATE_ON_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("TriggerResourceUpdateOn")
            .getter(getter(CreateSyncConfigurationRequest::triggerResourceUpdateOnAsString))
            .setter(setter(Builder::triggerResourceUpdateOn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TriggerResourceUpdateOn").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BRANCH_FIELD,
            CONFIG_FILE_FIELD, REPOSITORY_LINK_ID_FIELD, RESOURCE_NAME_FIELD, ROLE_ARN_FIELD, SYNC_TYPE_FIELD,
            PUBLISH_DEPLOYMENT_STATUS_FIELD, TRIGGER_RESOURCE_UPDATE_ON_FIELD));

    private final String branch;

    private final String configFile;

    private final String repositoryLinkId;

    private final String resourceName;

    private final String roleArn;

    private final String syncType;

    private final String publishDeploymentStatus;

    private final String triggerResourceUpdateOn;

    private CreateSyncConfigurationRequest(BuilderImpl builder) {
        super(builder);
        this.branch = builder.branch;
        this.configFile = builder.configFile;
        this.repositoryLinkId = builder.repositoryLinkId;
        this.resourceName = builder.resourceName;
        this.roleArn = builder.roleArn;
        this.syncType = builder.syncType;
        this.publishDeploymentStatus = builder.publishDeploymentStatus;
        this.triggerResourceUpdateOn = builder.triggerResourceUpdateOn;
    }

    /**
     * 

* The branch in the repository from which changes will be synced. *

* * @return The branch in the repository from which changes will be synced. */ public final String branch() { return branch; } /** *

* The file name of the configuration file that manages syncing between the connection and the repository. This * configuration file is stored in the repository. *

* * @return The file name of the configuration file that manages syncing between the connection and the repository. * This configuration file is stored in the repository. */ public final String configFile() { return configFile; } /** *

* The ID of the repository link created for the connection. A repository link allows Git sync to monitor and sync * changes to files in a specified Git repository. *

* * @return The ID of the repository link created for the connection. A repository link allows Git sync to monitor * and sync changes to files in a specified Git repository. */ public final String repositoryLinkId() { return repositoryLinkId; } /** *

* The name of the Amazon Web Services resource (for example, a CloudFormation stack in the case of CFN_STACK_SYNC) * that will be synchronized from the linked repository. *

* * @return The name of the Amazon Web Services resource (for example, a CloudFormation stack in the case of * CFN_STACK_SYNC) that will be synchronized from the linked repository. */ public final String resourceName() { return resourceName; } /** *

* The ARN of the IAM role that grants permission for Amazon Web Services to use Git sync to update a given Amazon * Web Services resource on your behalf. *

* * @return The ARN of the IAM role that grants permission for Amazon Web Services to use Git sync to update a given * Amazon Web Services resource on your behalf. */ public final String roleArn() { return roleArn; } /** *

* The type of sync configuration. *

*

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

* * @return The type of sync configuration. * @see SyncConfigurationType */ public final SyncConfigurationType syncType() { return SyncConfigurationType.fromValue(syncType); } /** *

* The type of sync configuration. *

*

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

* * @return The type of sync configuration. * @see SyncConfigurationType */ public final String syncTypeAsString() { return syncType; } /** *

* Whether to enable or disable publishing of deployment status to source providers. *

*

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

* * @return Whether to enable or disable publishing of deployment status to source providers. * @see PublishDeploymentStatus */ public final PublishDeploymentStatus publishDeploymentStatus() { return PublishDeploymentStatus.fromValue(publishDeploymentStatus); } /** *

* Whether to enable or disable publishing of deployment status to source providers. *

*

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

* * @return Whether to enable or disable publishing of deployment status to source providers. * @see PublishDeploymentStatus */ public final String publishDeploymentStatusAsString() { return publishDeploymentStatus; } /** *

* When to trigger Git sync to begin the stack update. *

*

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

* * @return When to trigger Git sync to begin the stack update. * @see TriggerResourceUpdateOn */ public final TriggerResourceUpdateOn triggerResourceUpdateOn() { return TriggerResourceUpdateOn.fromValue(triggerResourceUpdateOn); } /** *

* When to trigger Git sync to begin the stack update. *

*

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

* * @return When to trigger Git sync to begin the stack update. * @see TriggerResourceUpdateOn */ public final String triggerResourceUpdateOnAsString() { return triggerResourceUpdateOn; } @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(branch()); hashCode = 31 * hashCode + Objects.hashCode(configFile()); hashCode = 31 * hashCode + Objects.hashCode(repositoryLinkId()); hashCode = 31 * hashCode + Objects.hashCode(resourceName()); hashCode = 31 * hashCode + Objects.hashCode(roleArn()); hashCode = 31 * hashCode + Objects.hashCode(syncTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(publishDeploymentStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(triggerResourceUpdateOnAsString()); 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 CreateSyncConfigurationRequest)) { return false; } CreateSyncConfigurationRequest other = (CreateSyncConfigurationRequest) obj; return Objects.equals(branch(), other.branch()) && Objects.equals(configFile(), other.configFile()) && Objects.equals(repositoryLinkId(), other.repositoryLinkId()) && Objects.equals(resourceName(), other.resourceName()) && Objects.equals(roleArn(), other.roleArn()) && Objects.equals(syncTypeAsString(), other.syncTypeAsString()) && Objects.equals(publishDeploymentStatusAsString(), other.publishDeploymentStatusAsString()) && Objects.equals(triggerResourceUpdateOnAsString(), other.triggerResourceUpdateOnAsString()); } /** * 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("CreateSyncConfigurationRequest").add("Branch", branch()).add("ConfigFile", configFile()) .add("RepositoryLinkId", repositoryLinkId()).add("ResourceName", resourceName()).add("RoleArn", roleArn()) .add("SyncType", syncTypeAsString()).add("PublishDeploymentStatus", publishDeploymentStatusAsString()) .add("TriggerResourceUpdateOn", triggerResourceUpdateOnAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Branch": return Optional.ofNullable(clazz.cast(branch())); case "ConfigFile": return Optional.ofNullable(clazz.cast(configFile())); case "RepositoryLinkId": return Optional.ofNullable(clazz.cast(repositoryLinkId())); case "ResourceName": return Optional.ofNullable(clazz.cast(resourceName())); case "RoleArn": return Optional.ofNullable(clazz.cast(roleArn())); case "SyncType": return Optional.ofNullable(clazz.cast(syncTypeAsString())); case "PublishDeploymentStatus": return Optional.ofNullable(clazz.cast(publishDeploymentStatusAsString())); case "TriggerResourceUpdateOn": return Optional.ofNullable(clazz.cast(triggerResourceUpdateOnAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateSyncConfigurationRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends CodeStarConnectionsRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The branch in the repository from which changes will be synced. *

* * @param branch * The branch in the repository from which changes will be synced. * @return Returns a reference to this object so that method calls can be chained together. */ Builder branch(String branch); /** *

* The file name of the configuration file that manages syncing between the connection and the repository. This * configuration file is stored in the repository. *

* * @param configFile * The file name of the configuration file that manages syncing between the connection and the * repository. This configuration file is stored in the repository. * @return Returns a reference to this object so that method calls can be chained together. */ Builder configFile(String configFile); /** *

* The ID of the repository link created for the connection. A repository link allows Git sync to monitor and * sync changes to files in a specified Git repository. *

* * @param repositoryLinkId * The ID of the repository link created for the connection. A repository link allows Git sync to monitor * and sync changes to files in a specified Git repository. * @return Returns a reference to this object so that method calls can be chained together. */ Builder repositoryLinkId(String repositoryLinkId); /** *

* The name of the Amazon Web Services resource (for example, a CloudFormation stack in the case of * CFN_STACK_SYNC) that will be synchronized from the linked repository. *

* * @param resourceName * The name of the Amazon Web Services resource (for example, a CloudFormation stack in the case of * CFN_STACK_SYNC) that will be synchronized from the linked repository. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceName(String resourceName); /** *

* The ARN of the IAM role that grants permission for Amazon Web Services to use Git sync to update a given * Amazon Web Services resource on your behalf. *

* * @param roleArn * The ARN of the IAM role that grants permission for Amazon Web Services to use Git sync to update a * given Amazon Web Services resource on your behalf. * @return Returns a reference to this object so that method calls can be chained together. */ Builder roleArn(String roleArn); /** *

* The type of sync configuration. *

* * @param syncType * The type of sync configuration. * @see SyncConfigurationType * @return Returns a reference to this object so that method calls can be chained together. * @see SyncConfigurationType */ Builder syncType(String syncType); /** *

* The type of sync configuration. *

* * @param syncType * The type of sync configuration. * @see SyncConfigurationType * @return Returns a reference to this object so that method calls can be chained together. * @see SyncConfigurationType */ Builder syncType(SyncConfigurationType syncType); /** *

* Whether to enable or disable publishing of deployment status to source providers. *

* * @param publishDeploymentStatus * Whether to enable or disable publishing of deployment status to source providers. * @see PublishDeploymentStatus * @return Returns a reference to this object so that method calls can be chained together. * @see PublishDeploymentStatus */ Builder publishDeploymentStatus(String publishDeploymentStatus); /** *

* Whether to enable or disable publishing of deployment status to source providers. *

* * @param publishDeploymentStatus * Whether to enable or disable publishing of deployment status to source providers. * @see PublishDeploymentStatus * @return Returns a reference to this object so that method calls can be chained together. * @see PublishDeploymentStatus */ Builder publishDeploymentStatus(PublishDeploymentStatus publishDeploymentStatus); /** *

* When to trigger Git sync to begin the stack update. *

* * @param triggerResourceUpdateOn * When to trigger Git sync to begin the stack update. * @see TriggerResourceUpdateOn * @return Returns a reference to this object so that method calls can be chained together. * @see TriggerResourceUpdateOn */ Builder triggerResourceUpdateOn(String triggerResourceUpdateOn); /** *

* When to trigger Git sync to begin the stack update. *

* * @param triggerResourceUpdateOn * When to trigger Git sync to begin the stack update. * @see TriggerResourceUpdateOn * @return Returns a reference to this object so that method calls can be chained together. * @see TriggerResourceUpdateOn */ Builder triggerResourceUpdateOn(TriggerResourceUpdateOn triggerResourceUpdateOn); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends CodeStarConnectionsRequest.BuilderImpl implements Builder { private String branch; private String configFile; private String repositoryLinkId; private String resourceName; private String roleArn; private String syncType; private String publishDeploymentStatus; private String triggerResourceUpdateOn; private BuilderImpl() { } private BuilderImpl(CreateSyncConfigurationRequest model) { super(model); branch(model.branch); configFile(model.configFile); repositoryLinkId(model.repositoryLinkId); resourceName(model.resourceName); roleArn(model.roleArn); syncType(model.syncType); publishDeploymentStatus(model.publishDeploymentStatus); triggerResourceUpdateOn(model.triggerResourceUpdateOn); } public final String getBranch() { return branch; } public final void setBranch(String branch) { this.branch = branch; } @Override public final Builder branch(String branch) { this.branch = branch; return this; } public final String getConfigFile() { return configFile; } public final void setConfigFile(String configFile) { this.configFile = configFile; } @Override public final Builder configFile(String configFile) { this.configFile = configFile; return this; } public final String getRepositoryLinkId() { return repositoryLinkId; } public final void setRepositoryLinkId(String repositoryLinkId) { this.repositoryLinkId = repositoryLinkId; } @Override public final Builder repositoryLinkId(String repositoryLinkId) { this.repositoryLinkId = repositoryLinkId; return this; } public final String getResourceName() { return resourceName; } public final void setResourceName(String resourceName) { this.resourceName = resourceName; } @Override public final Builder resourceName(String resourceName) { this.resourceName = resourceName; return this; } public final String getRoleArn() { return roleArn; } public final void setRoleArn(String roleArn) { this.roleArn = roleArn; } @Override public final Builder roleArn(String roleArn) { this.roleArn = roleArn; return this; } public final String getSyncType() { return syncType; } public final void setSyncType(String syncType) { this.syncType = syncType; } @Override public final Builder syncType(String syncType) { this.syncType = syncType; return this; } @Override public final Builder syncType(SyncConfigurationType syncType) { this.syncType(syncType == null ? null : syncType.toString()); return this; } public final String getPublishDeploymentStatus() { return publishDeploymentStatus; } public final void setPublishDeploymentStatus(String publishDeploymentStatus) { this.publishDeploymentStatus = publishDeploymentStatus; } @Override public final Builder publishDeploymentStatus(String publishDeploymentStatus) { this.publishDeploymentStatus = publishDeploymentStatus; return this; } @Override public final Builder publishDeploymentStatus(PublishDeploymentStatus publishDeploymentStatus) { this.publishDeploymentStatus(publishDeploymentStatus == null ? null : publishDeploymentStatus.toString()); return this; } public final String getTriggerResourceUpdateOn() { return triggerResourceUpdateOn; } public final void setTriggerResourceUpdateOn(String triggerResourceUpdateOn) { this.triggerResourceUpdateOn = triggerResourceUpdateOn; } @Override public final Builder triggerResourceUpdateOn(String triggerResourceUpdateOn) { this.triggerResourceUpdateOn = triggerResourceUpdateOn; return this; } @Override public final Builder triggerResourceUpdateOn(TriggerResourceUpdateOn triggerResourceUpdateOn) { this.triggerResourceUpdateOn(triggerResourceUpdateOn == null ? null : triggerResourceUpdateOn.toString()); 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 CreateSyncConfigurationRequest build() { return new CreateSyncConfigurationRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy