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

software.amazon.awssdk.services.codegurureviewer.model.S3RepositoryDetails Maven / Gradle / Ivy

Go to download

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

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.codegurureviewer.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;

/**
 * 

* Specifies the name of an S3 bucket and a CodeArtifacts object that contains the S3 object keys for a * source code .zip file and for a build artifacts .zip file that contains .jar or .class files. *

*/ @Generated("software.amazon.awssdk:codegen") public final class S3RepositoryDetails implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField BUCKET_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("BucketName").getter(getter(S3RepositoryDetails::bucketName)).setter(setter(Builder::bucketName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BucketName").build()).build(); private static final SdkField CODE_ARTIFACTS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("CodeArtifacts") .getter(getter(S3RepositoryDetails::codeArtifacts)).setter(setter(Builder::codeArtifacts)) .constructor(CodeArtifacts::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CodeArtifacts").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BUCKET_NAME_FIELD, CODE_ARTIFACTS_FIELD)); private static final long serialVersionUID = 1L; private final String bucketName; private final CodeArtifacts codeArtifacts; private S3RepositoryDetails(BuilderImpl builder) { this.bucketName = builder.bucketName; this.codeArtifacts = builder.codeArtifacts; } /** *

* The name of the S3 bucket used for associating a new S3 repository. It must begin with * codeguru-reviewer-. *

* * @return The name of the S3 bucket used for associating a new S3 repository. It must begin with * codeguru-reviewer-. */ public final String bucketName() { return bucketName; } /** *

* A CodeArtifacts object. The CodeArtifacts object includes the S3 object key for a * source code .zip file and for a build artifacts .zip file that contains .jar or .class files. *

* * @return A CodeArtifacts object. The CodeArtifacts object includes the S3 object key for * a source code .zip file and for a build artifacts .zip file that contains .jar or .class files. */ public final CodeArtifacts codeArtifacts() { return codeArtifacts; } @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(bucketName()); hashCode = 31 * hashCode + Objects.hashCode(codeArtifacts()); 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 S3RepositoryDetails)) { return false; } S3RepositoryDetails other = (S3RepositoryDetails) obj; return Objects.equals(bucketName(), other.bucketName()) && Objects.equals(codeArtifacts(), other.codeArtifacts()); } /** * 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("S3RepositoryDetails").add("BucketName", bucketName()).add("CodeArtifacts", codeArtifacts()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "BucketName": return Optional.ofNullable(clazz.cast(bucketName())); case "CodeArtifacts": return Optional.ofNullable(clazz.cast(codeArtifacts())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((S3RepositoryDetails) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the S3 bucket used for associating a new S3 repository. It must begin with * codeguru-reviewer-. *

* * @param bucketName * The name of the S3 bucket used for associating a new S3 repository. It must begin with * codeguru-reviewer-. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bucketName(String bucketName); /** *

* A CodeArtifacts object. The CodeArtifacts object includes the S3 object key for a * source code .zip file and for a build artifacts .zip file that contains .jar or .class files. *

* * @param codeArtifacts * A CodeArtifacts object. The CodeArtifacts object includes the S3 object key * for a source code .zip file and for a build artifacts .zip file that contains .jar or .class files. * @return Returns a reference to this object so that method calls can be chained together. */ Builder codeArtifacts(CodeArtifacts codeArtifacts); /** *

* A CodeArtifacts object. The CodeArtifacts object includes the S3 object key for a * source code .zip file and for a build artifacts .zip file that contains .jar or .class files. *

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

* When the {@link Consumer} completes, {@link CodeArtifacts.Builder#build()} is called immediately and its * result is passed to {@link #codeArtifacts(CodeArtifacts)}. * * @param codeArtifacts * a consumer that will call methods on {@link CodeArtifacts.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #codeArtifacts(CodeArtifacts) */ default Builder codeArtifacts(Consumer codeArtifacts) { return codeArtifacts(CodeArtifacts.builder().applyMutation(codeArtifacts).build()); } } static final class BuilderImpl implements Builder { private String bucketName; private CodeArtifacts codeArtifacts; private BuilderImpl() { } private BuilderImpl(S3RepositoryDetails model) { bucketName(model.bucketName); codeArtifacts(model.codeArtifacts); } public final String getBucketName() { return bucketName; } public final void setBucketName(String bucketName) { this.bucketName = bucketName; } @Override public final Builder bucketName(String bucketName) { this.bucketName = bucketName; return this; } public final CodeArtifacts.Builder getCodeArtifacts() { return codeArtifacts != null ? codeArtifacts.toBuilder() : null; } public final void setCodeArtifacts(CodeArtifacts.BuilderImpl codeArtifacts) { this.codeArtifacts = codeArtifacts != null ? codeArtifacts.build() : null; } @Override public final Builder codeArtifacts(CodeArtifacts codeArtifacts) { this.codeArtifacts = codeArtifacts; return this; } @Override public S3RepositoryDetails build() { return new S3RepositoryDetails(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy