Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/main/java/com/spotify/github/v3/clients/SearchClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package com.spotify.github.v3.clients;

import com.google.common.base.Strings;
import com.spotify.github.v3.search.SearchCommits;
import com.spotify.github.v3.search.SearchIssues;
import com.spotify.github.v3.search.SearchRepositories;
import com.spotify.github.v3.search.SearchUsers;
Expand All @@ -37,6 +38,7 @@ public class SearchClient {
static final String USERS_URI = "/search/users";
static final String REPOSITORIES_URI = "/search/repositories";
static final String ISSUES_URI = "/search/issues";
static final String COMMIT_URI = "/search/commits";
private final GitHubClient github;

SearchClient(final GitHubClient github) {
Expand All @@ -47,6 +49,16 @@ static SearchClient create(final GitHubClient github) {
return new SearchClient(github);
}

/**
* Search commits.
*
* @param parameters commit search parameters
* @return commit search results
*/
public CompletableFuture<SearchCommits> commits(final SearchParameters parameters) {
return search(COMMIT_URI, parameters, SearchCommits.class);
}

/**
* Search users.
*
Expand Down
42 changes: 42 additions & 0 deletions src/main/java/com/spotify/github/v3/search/SearchCommits.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*-
* -\-\-
* github-api
* --
* Copyright (C) 2016 - 2023 Spotify AB
* --
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License 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 com.spotify.github.v3.search;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.spotify.github.GithubStyle;
import com.spotify.github.v3.repos.Commit;
import org.immutables.value.Value;

import java.util.List;
import javax.annotation.Nullable;

/** Commits search result resource */
@Value.Immutable
@GithubStyle
@JsonSerialize(as = ImmutableSearchCommits.class)
@JsonDeserialize(as = ImmutableSearchCommits.class)
public interface SearchCommits extends Search {

/** Commits search results */
@Nullable
List<Commit> items();
}