Package org.a2aproject.sdk.spec
Class OAuth2SecurityScheme.Builder
java.lang.Object
org.a2aproject.sdk.spec.OAuth2SecurityScheme.Builder
- Enclosing class:
- OAuth2SecurityScheme
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 Summary
Modifier and TypeMethodDescriptionbuild()Builds a new immutableOAuth2SecuritySchemefrom the current builder state.description(String description) Sets the human-readable description of the security scheme.flows(OAuthFlows flows) Sets the OAuth flows configuration.oauth2MetadataUrl(String oauth2MetadataUrl) Sets the OAuth 2.0 metadata URL.
-
Method Details
-
flows
Sets the OAuth flows configuration.- Parameters:
flows- the OAuth 2.0 flow configuration (required)- Returns:
- this builder for method chaining
-
description
Sets the human-readable description of the security scheme.- Parameters:
description- the description (optional)- Returns:
- this builder for method chaining
-
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
Builds a new immutableOAuth2SecuritySchemefrom the current builder state.- Returns:
- a new OAuth2SecurityScheme instance
- Throws:
IllegalArgumentException- if flows is null
-