Package org.a2aproject.sdk.spec
Class APIKeySecurityScheme.Builder
java.lang.Object
org.a2aproject.sdk.spec.APIKeySecurityScheme.Builder
- Enclosing class:
- APIKeySecurityScheme
Builder for constructing immutable
APIKeySecurityScheme instances.
Example usage:
APIKeySecurityScheme scheme = APIKeySecurityScheme.builder()
.location(Location.HEADER)
.name("X-API-Key")
.description("API key authentication")
.build();
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new immutableAPIKeySecuritySchemefrom the current builder state.description(String description) Sets the human-readable description of the security scheme.location(APIKeySecurityScheme.Location location) Sets the location where the API key should be sent.Sets the name of the API key parameter.
-
Method Details
-
location
Sets the location where the API key should be sent.- Parameters:
location- the API key location (header, query, or cookie) (required)- Returns:
- this builder for method chaining
-
name
Sets the name of the API key parameter.- Parameters:
name- the parameter name (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
-
build
Builds a new immutableAPIKeySecuritySchemefrom the current builder state.- Returns:
- a new APIKeySecurityScheme instance
- Throws:
IllegalArgumentException- if location or name is null
-