Class VideoCreateParams.InputReference
-
- All Implemented Interfaces:
public final class VideoCreateParams.InputReferenceOptional reference asset upload or reference object that guides generation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceVideoCreateParams.InputReference.VisitorAn interface that defines how to map each variant of InputReference to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<InputStream>stream()Optional reference asset upload or reference object that guides generation. final Optional<ImageInputReferenceParam>imageInputReferenceParam()final BooleanisStream()final BooleanisImageInputReferenceParam()final InputStreamasStream()Optional reference asset upload or reference object that guides generation. final ImageInputReferenceParamasImageInputReferenceParam()final Optional<JsonValue>_json()final <T extends Any> Taccept(VideoCreateParams.InputReference.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final VideoCreateParams.InputReferencevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static VideoCreateParams.InputReferenceofStream(InputStream stream)Optional reference asset upload or reference object that guides generation. final static VideoCreateParams.InputReferenceofImageInputReferenceParam(ImageInputReferenceParam imageInputReferenceParam)-
-
Method Detail
-
stream
final Optional<InputStream> stream()
Optional reference asset upload or reference object that guides generation.
-
imageInputReferenceParam
final Optional<ImageInputReferenceParam> imageInputReferenceParam()
-
isImageInputReferenceParam
final Boolean isImageInputReferenceParam()
-
asStream
final InputStream asStream()
Optional reference asset upload or reference object that guides generation.
-
asImageInputReferenceParam
final ImageInputReferenceParam asImageInputReferenceParam()
-
accept
final <T extends Any> T accept(VideoCreateParams.InputReference.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = inputReference.accept(new InputReference.Visitor<Optional<String>>() { @Override public Optional<String> visitStream(InputStream stream) { return Optional.of(stream.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final VideoCreateParams.InputReference validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofStream
final static VideoCreateParams.InputReference ofStream(InputStream stream)
Optional reference asset upload or reference object that guides generation.
-
ofImageInputReferenceParam
final static VideoCreateParams.InputReference ofImageInputReferenceParam(ImageInputReferenceParam imageInputReferenceParam)
-
-
-
-