Class GitHubSecurityAdvisoryClientBuilder


  • public final class GitHubSecurityAdvisoryClientBuilder
    extends java.lang.Object
    Used 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 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; if null a 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