Class ApiError.Builder
- java.lang.Object
-
- ai.extend.types.ApiError.Builder
-
- All Implemented Interfaces:
ApiError._FinalStage,ApiError.CodeStage,ApiError.MessageStage,ApiError.RetryableStage
- Enclosing class:
- ApiError
public static final class ApiError.Builder extends java.lang.Object implements ApiError.CodeStage, ApiError.MessageStage, ApiError.RetryableStage, ApiError._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiErrorbuild()ApiError.MessageStagecode(java.lang.String code)Error code for programmatic handling.ApiError._FinalStagedocUrl(java.lang.String docUrl)Link to relevant documentation when one is available.ApiError._FinalStagedocUrl(java.util.Optional<java.lang.String> docUrl)Link to relevant documentation when one is available.ApiError.Builderfrom(ApiError other)ApiError.RetryableStagemessage(java.lang.String message)Human-readable error message suitable for displaying to developers.ApiError._FinalStagerequestId(java.lang.String requestId)Unique request identifier for support purposes.ApiError._FinalStagerequestId(java.util.Optional<java.lang.String> requestId)Unique request identifier for support purposes.ApiError._FinalStageretryable(boolean retryable)Whether the request can be retried.
-
-
-
Method Detail
-
from
public ApiError.Builder from(ApiError other)
- Specified by:
fromin interfaceApiError.CodeStage
-
code
public ApiError.MessageStage code(@NotNull java.lang.String code)
Error code for programmatic handling.
Error code for programmatic handling.
- Specified by:
codein interfaceApiError.CodeStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
message
public ApiError.RetryableStage message(@NotNull java.lang.String message)
Human-readable error message suitable for displaying to developers. Do not rely on the exact text of this message as it may change.
Human-readable error message suitable for displaying to developers. Do not rely on the exact text of this message as it may change.
- Specified by:
messagein interfaceApiError.MessageStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
retryable
public ApiError._FinalStage retryable(boolean retryable)
Whether the request can be retried. When true, retry with exponential backoff. When false, fix the underlying issue before retrying.
Whether the request can be retried. When true, retry with exponential backoff. When false, fix the underlying issue before retrying.
- Specified by:
retryablein interfaceApiError.RetryableStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
docUrl
public ApiError._FinalStage docUrl(java.lang.String docUrl)
Link to relevant documentation when one is available.
- Specified by:
docUrlin interfaceApiError._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
docUrl
public ApiError._FinalStage docUrl(java.util.Optional<java.lang.String> docUrl)
Link to relevant documentation when one is available.
- Specified by:
docUrlin interfaceApiError._FinalStage
-
requestId
public ApiError._FinalStage requestId(java.lang.String requestId)
Unique request identifier for support purposes. Always include this when contacting Extend support about an error.
- Specified by:
requestIdin interfaceApiError._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
requestId
public ApiError._FinalStage requestId(java.util.Optional<java.lang.String> requestId)
Unique request identifier for support purposes. Always include this when contacting Extend support about an error.
- Specified by:
requestIdin interfaceApiError._FinalStage
-
build
public ApiError build()
- Specified by:
buildin interfaceApiError._FinalStage
-
-