Class GitHubSecurityAdvisoryClientBuilder
- java.lang.Object
-
- io.github.jeremylong.openvulnerability.client.ghsa.GitHubSecurityAdvisoryClientBuilder
-
public final class GitHubSecurityAdvisoryClientBuilder extends java.lang.ObjectUsed to build an GitHub SecurityAdvisory GraphQL API client. As the GitHubSecurityAdvisoryClient client is autocloseable the builder should be used in a try with resources:try (GitHubSecurityAdvisoryClient api = GitHubSecurityAdvisoryClientBuilder.aGitHubSecurityAdvisoryClient() .withApiKey(githubToken).build()) { while (api.hasNext()) { Collection<SecurityAdvisory> items = api.next(); } }
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GitHubSecurityAdvisoryClientBuilderaGitHubSecurityAdvisoryClient()Begin building the GitHub GraphQL for SecurityAdvisories Object.GitHubSecurityAdvisoryClientbuild()Build the GitHub SecurityAdvisory GraphQL API client.GitHubSecurityAdvisoryClientBuilderwithAdditionalUserAgent(java.lang.String userAgent)Use an additional identifier as part of the User-Agent when making requests.GitHubSecurityAdvisoryClientBuilderwithApiKey(java.lang.String apiKey)Use an GitHub SecurityAdvisory GraphQL API key.GitHubSecurityAdvisoryClientBuilderwithClassifications(java.lang.String classifications)The classification of the advisory ("GENERAL", "MALWARE")GitHubSecurityAdvisoryClientBuilderwithEndpoint(java.lang.String endpoint)Use an alternative endpoint for the GitHub SecurityAdvisory GraphQL API.GitHubSecurityAdvisoryClientBuilderwithHttpClientSupplier(HttpAsyncClientSupplier httpClientSupplier)Provide a supplier for custom HTTP clients.GitHubSecurityAdvisoryClientBuilderwithPublishedSinceFilter(java.time.ZonedDateTime utcStartDate)Filter the results with a range of published since date/time.GitHubSecurityAdvisoryClientBuilderwithUpdatedSinceFilter(java.time.ZonedDateTime utcUpdatedSince)Filter for Security Advisories that have been updated since a specific date/time.
-
-
-
Method Detail
-
aGitHubSecurityAdvisoryClient
public static GitHubSecurityAdvisoryClientBuilder aGitHubSecurityAdvisoryClient()
Begin building the GitHub GraphQL for SecurityAdvisories Object.- Returns:
- the builder
-
withApiKey
public GitHubSecurityAdvisoryClientBuilder withApiKey(java.lang.String apiKey)
Use an GitHub SecurityAdvisory GraphQL API key.- Parameters:
apiKey- the GitHub API key.- Returns:
- the builder
-
withAdditionalUserAgent
public GitHubSecurityAdvisoryClientBuilder withAdditionalUserAgent(java.lang.String userAgent)
Use an additional identifier as part of the User-Agent when making requests.- Parameters:
userAgent- the user agent string to append- Returns:
- the builder
-
withEndpoint
public GitHubSecurityAdvisoryClientBuilder withEndpoint(java.lang.String endpoint)
Use an alternative endpoint for the GitHub SecurityAdvisory GraphQL API.- Parameters:
endpoint- the endpoint for the GitHub SecurityAdvisory GraphQL API- Returns:
- the builder
-
withClassifications
public GitHubSecurityAdvisoryClientBuilder withClassifications(java.lang.String classifications)
The classification of the advisory ("GENERAL", "MALWARE")- Parameters:
classifications- the classification of the advisory- Returns:
- the builder
-
withUpdatedSinceFilter
public GitHubSecurityAdvisoryClientBuilder withUpdatedSinceFilter(java.time.ZonedDateTime utcUpdatedSince)
Filter for Security Advisories that have been updated since a specific date/time.- Parameters:
utcUpdatedSince- the UTC date time- Returns:
- the builder
-
withPublishedSinceFilter
public GitHubSecurityAdvisoryClientBuilder withPublishedSinceFilter(java.time.ZonedDateTime utcStartDate)
Filter the results with a range of published since date/time.- Parameters:
utcStartDate- the UTC date time for the range start- Returns:
- the builder
-
withHttpClientSupplier
public GitHubSecurityAdvisoryClientBuilder withHttpClientSupplier(HttpAsyncClientSupplier httpClientSupplier)
Provide a supplier for custom HTTP clients.- Parameters:
httpClientSupplier- supplier for custom HTTP clients; ifnulla default client will be used- Returns:
- the builder
-
build
public GitHubSecurityAdvisoryClient build()
Build the GitHub SecurityAdvisory GraphQL API client.- Returns:
- the GitHub SecurityAdvisory GraphQL API client
-
-