ServerVariable class abstract
An object representing a Server Variable for server URL template substitution.
This class encapsulates the data for a server variable definition in an OpenAPI document, including its possible values, default value, and description.
- Available extensions
- Annotations
-
- @Freezed.new(copyWith: true, fromJson: true, toJson: true, equal: true)
Constructors
-
ServerVariable({@JsonKey.new(name: 'default') required String defaultValue, @JsonKey.new(name: 'enum') List<
String> ? enumValues, String? description}) -
Creates a ServerVariable object.
constfactory
-
ServerVariable.fromJson(Map<
String, dynamic> json) -
Creates a ServerVariable from a JSON object.
factory
Properties
-
copyWith
→ $ServerVariableCopyWith<
ServerVariable> -
Create a copy of ServerVariable
with the given fields replaced by the non-null parameter values.
no setterinherited
- defaultValue → String
-
REQUIRED. The default value to use for substitution, which SHALL be sent
if an alternate value is not supplied.
no setterinherited
- description → String?
-
An optional description for the server variable.
no setterinherited
-
enumValues
→ List<
String> ? -
An enumeration of string values to be used if the substitution
options are from a limited set. The array MUST NOT be empty.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_ServerVariable value)) → TResult -
Available on ServerVariable, provided by the ServerVariablePatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_ServerVariable value)?) → TResult? -
Available on ServerVariable, provided by the ServerVariablePatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_ServerVariable value)?, {required TResult orElse()}) → TResult -
Available on ServerVariable, provided by the ServerVariablePatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(String defaultValue, List< String> ? enumValues, String? description)?, {required TResult orElse()}) → TResult -
Available on ServerVariable, provided by the ServerVariablePatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this ServerVariable to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(String defaultValue, List< String> ? enumValues, String? description)) → TResult -
Available on ServerVariable, provided by the ServerVariablePatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(String defaultValue, List< String> ? enumValues, String? description)?) → TResult? -
Available on ServerVariable, provided by the ServerVariablePatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited