software.amazon.awssdk.services.kendra.model.GitHubDocumentCrawlProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kendra Show documentation
Show all versions of kendra Show documentation
The AWS Java SDK for Kendra module holds the client classes that are used for
communicating with Kendra.
/*
* 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.kendra.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.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;
/**
*
* Provides the configuration information to include certain types of GitHub content. You can configure to index
* repository files only, or also include issues and pull requests, comments, and comment attachments.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class GitHubDocumentCrawlProperties implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CRAWL_REPOSITORY_DOCUMENTS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CrawlRepositoryDocuments").getter(getter(GitHubDocumentCrawlProperties::crawlRepositoryDocuments))
.setter(setter(Builder::crawlRepositoryDocuments))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CrawlRepositoryDocuments").build())
.build();
private static final SdkField CRAWL_ISSUE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CrawlIssue").getter(getter(GitHubDocumentCrawlProperties::crawlIssue))
.setter(setter(Builder::crawlIssue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CrawlIssue").build()).build();
private static final SdkField CRAWL_ISSUE_COMMENT_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CrawlIssueComment").getter(getter(GitHubDocumentCrawlProperties::crawlIssueComment))
.setter(setter(Builder::crawlIssueComment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CrawlIssueComment").build()).build();
private static final SdkField CRAWL_ISSUE_COMMENT_ATTACHMENT_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("CrawlIssueCommentAttachment")
.getter(getter(GitHubDocumentCrawlProperties::crawlIssueCommentAttachment))
.setter(setter(Builder::crawlIssueCommentAttachment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CrawlIssueCommentAttachment")
.build()).build();
private static final SdkField CRAWL_PULL_REQUEST_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CrawlPullRequest").getter(getter(GitHubDocumentCrawlProperties::crawlPullRequest))
.setter(setter(Builder::crawlPullRequest))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CrawlPullRequest").build()).build();
private static final SdkField CRAWL_PULL_REQUEST_COMMENT_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CrawlPullRequestComment").getter(getter(GitHubDocumentCrawlProperties::crawlPullRequestComment))
.setter(setter(Builder::crawlPullRequestComment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CrawlPullRequestComment").build())
.build();
private static final SdkField CRAWL_PULL_REQUEST_COMMENT_ATTACHMENT_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("CrawlPullRequestCommentAttachment")
.getter(getter(GitHubDocumentCrawlProperties::crawlPullRequestCommentAttachment))
.setter(setter(Builder::crawlPullRequestCommentAttachment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CrawlPullRequestCommentAttachment")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
CRAWL_REPOSITORY_DOCUMENTS_FIELD, CRAWL_ISSUE_FIELD, CRAWL_ISSUE_COMMENT_FIELD, CRAWL_ISSUE_COMMENT_ATTACHMENT_FIELD,
CRAWL_PULL_REQUEST_FIELD, CRAWL_PULL_REQUEST_COMMENT_FIELD, CRAWL_PULL_REQUEST_COMMENT_ATTACHMENT_FIELD));
private static final long serialVersionUID = 1L;
private final Boolean crawlRepositoryDocuments;
private final Boolean crawlIssue;
private final Boolean crawlIssueComment;
private final Boolean crawlIssueCommentAttachment;
private final Boolean crawlPullRequest;
private final Boolean crawlPullRequestComment;
private final Boolean crawlPullRequestCommentAttachment;
private GitHubDocumentCrawlProperties(BuilderImpl builder) {
this.crawlRepositoryDocuments = builder.crawlRepositoryDocuments;
this.crawlIssue = builder.crawlIssue;
this.crawlIssueComment = builder.crawlIssueComment;
this.crawlIssueCommentAttachment = builder.crawlIssueCommentAttachment;
this.crawlPullRequest = builder.crawlPullRequest;
this.crawlPullRequestComment = builder.crawlPullRequestComment;
this.crawlPullRequestCommentAttachment = builder.crawlPullRequestCommentAttachment;
}
/**
*
* TRUE
to index all files with a repository.
*
*
* @return TRUE
to index all files with a repository.
*/
public final Boolean crawlRepositoryDocuments() {
return crawlRepositoryDocuments;
}
/**
*
* TRUE
to index all issues within a repository.
*
*
* @return TRUE
to index all issues within a repository.
*/
public final Boolean crawlIssue() {
return crawlIssue;
}
/**
*
* TRUE
to index all comments on issues.
*
*
* @return TRUE
to index all comments on issues.
*/
public final Boolean crawlIssueComment() {
return crawlIssueComment;
}
/**
*
* TRUE
to include all comment attachments for issues.
*
*
* @return TRUE
to include all comment attachments for issues.
*/
public final Boolean crawlIssueCommentAttachment() {
return crawlIssueCommentAttachment;
}
/**
*
* TRUE
to index all pull requests within a repository.
*
*
* @return TRUE
to index all pull requests within a repository.
*/
public final Boolean crawlPullRequest() {
return crawlPullRequest;
}
/**
*
* TRUE
to index all comments on pull requests.
*
*
* @return TRUE
to index all comments on pull requests.
*/
public final Boolean crawlPullRequestComment() {
return crawlPullRequestComment;
}
/**
*
* TRUE
to include all comment attachments for pull requests.
*
*
* @return TRUE
to include all comment attachments for pull requests.
*/
public final Boolean crawlPullRequestCommentAttachment() {
return crawlPullRequestCommentAttachment;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(crawlRepositoryDocuments());
hashCode = 31 * hashCode + Objects.hashCode(crawlIssue());
hashCode = 31 * hashCode + Objects.hashCode(crawlIssueComment());
hashCode = 31 * hashCode + Objects.hashCode(crawlIssueCommentAttachment());
hashCode = 31 * hashCode + Objects.hashCode(crawlPullRequest());
hashCode = 31 * hashCode + Objects.hashCode(crawlPullRequestComment());
hashCode = 31 * hashCode + Objects.hashCode(crawlPullRequestCommentAttachment());
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 GitHubDocumentCrawlProperties)) {
return false;
}
GitHubDocumentCrawlProperties other = (GitHubDocumentCrawlProperties) obj;
return Objects.equals(crawlRepositoryDocuments(), other.crawlRepositoryDocuments())
&& Objects.equals(crawlIssue(), other.crawlIssue())
&& Objects.equals(crawlIssueComment(), other.crawlIssueComment())
&& Objects.equals(crawlIssueCommentAttachment(), other.crawlIssueCommentAttachment())
&& Objects.equals(crawlPullRequest(), other.crawlPullRequest())
&& Objects.equals(crawlPullRequestComment(), other.crawlPullRequestComment())
&& Objects.equals(crawlPullRequestCommentAttachment(), other.crawlPullRequestCommentAttachment());
}
/**
* 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("GitHubDocumentCrawlProperties").add("CrawlRepositoryDocuments", crawlRepositoryDocuments())
.add("CrawlIssue", crawlIssue()).add("CrawlIssueComment", crawlIssueComment())
.add("CrawlIssueCommentAttachment", crawlIssueCommentAttachment()).add("CrawlPullRequest", crawlPullRequest())
.add("CrawlPullRequestComment", crawlPullRequestComment())
.add("CrawlPullRequestCommentAttachment", crawlPullRequestCommentAttachment()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CrawlRepositoryDocuments":
return Optional.ofNullable(clazz.cast(crawlRepositoryDocuments()));
case "CrawlIssue":
return Optional.ofNullable(clazz.cast(crawlIssue()));
case "CrawlIssueComment":
return Optional.ofNullable(clazz.cast(crawlIssueComment()));
case "CrawlIssueCommentAttachment":
return Optional.ofNullable(clazz.cast(crawlIssueCommentAttachment()));
case "CrawlPullRequest":
return Optional.ofNullable(clazz.cast(crawlPullRequest()));
case "CrawlPullRequestComment":
return Optional.ofNullable(clazz.cast(crawlPullRequestComment()));
case "CrawlPullRequestCommentAttachment":
return Optional.ofNullable(clazz.cast(crawlPullRequestCommentAttachment()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function