Class OAuth2SecurityScheme.Builder

java.lang.Object
org.a2aproject.sdk.spec.OAuth2SecurityScheme.Builder
Enclosing class:
OAuth2SecurityScheme

public static class OAuth2SecurityScheme.Builder extends Object
Builder for constructing immutable OAuth2SecurityScheme instances.

Example usage:


 OAuth2SecurityScheme scheme = OAuth2SecurityScheme.builder()
     .flows(flows)
     .description("OAuth 2.0 authentication")
     .oauth2MetadataUrl("https://example.com/.well-known/oauth-authorization-server")
     .build();
 
  • Method Details

    • flows

      Sets the OAuth flows configuration.
      Parameters:
      flows - the OAuth 2.0 flow configuration (required)
      Returns:
      this builder for method chaining
    • description

      public OAuth2SecurityScheme.Builder description(String description)
      Sets the human-readable description of the security scheme.
      Parameters:
      description - the description (optional)
      Returns:
      this builder for method chaining
    • oauth2MetadataUrl

      public OAuth2SecurityScheme.Builder oauth2MetadataUrl(String oauth2MetadataUrl)
      Sets the OAuth 2.0 metadata URL.
      Parameters:
      oauth2MetadataUrl - URL to OAuth 2.0 metadata document (RFC 8414) (optional)
      Returns:
      this builder for method chaining
    • build

      public OAuth2SecurityScheme build()
      Builds a new immutable OAuth2SecurityScheme from the current builder state.
      Returns:
      a new OAuth2SecurityScheme instance
      Throws:
      IllegalArgumentException - if flows is null