Operation class abstract
Describes a single API operation on a path.
This class encapsulates all metadata for an API endpoint, including parameters, request bodies, and responses.
- Available extensions
- Annotations
-
- @Freezed.new(copyWith: true, fromJson: true, toJson: true, equal: true)
Constructors
-
Operation({@Default.new([]) List<
String> tags, String? summary, String? description, String? operationId, @Default.new([]) List<Parameter> parameters, RequestBody? requestBody, @Default.new({}) Map<String, Response> responses, @Default.new([]) List<SecurityRequirement> security, List<String> ? consumes, List<String> ? produces, bool? deprecated}) -
Creates an Operation object.
constfactory
-
Operation.fromJson(Map<
String, dynamic> json) -
Creates an Operation from a JSON object.
factory
Properties
-
consumes
→ List<
String> ? -
A list of MIME types the operation can consume (OpenAPI 2.0).
no setterinherited
-
copyWith
→ $OperationCopyWith<
Operation> -
Create a copy of Operation
with the given fields replaced by the non-null parameter values.
no setterinherited
- deprecated → bool?
-
Specifies whether the operation is deprecated.
no setterinherited
- description → String?
-
A detailed description of the operation.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- operationId → String?
-
A unique string used to identify the operation.
no setterinherited
-
parameters
→ List<
Parameter> -
A list of parameters for the operation.
no setterinherited
-
produces
→ List<
String> ? -
A list of MIME types the operation can produce (OpenAPI 2.0).
no setterinherited
- requestBody → RequestBody?
-
The request body of the operation.
no setterinherited
-
responses
→ Map<
String, Response> -
The possible responses for the operation.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
security
→ List<
SecurityRequirement> -
A declaration of which security schemes are required for this operation.
no setterinherited
- summary → String?
-
A brief summary of the operation.
no setterinherited
-
A list of tags for API documentation.
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_Operation value)) → TResult -
Available on Operation, provided by the OperationPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_Operation value)?) → TResult? -
Available on Operation, provided by the OperationPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_Operation value)?, {required TResult orElse()}) → TResult -
Available on Operation, provided by the OperationPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(List< String> tags, String? summary, String? description, String? operationId, List<Parameter> parameters, RequestBody? requestBody, Map<String, Response> responses, List<SecurityRequirement> security, List<String> ? consumes, List<String> ? produces, bool? deprecated)?, {required TResult orElse()}) → TResult -
Available on Operation, provided by the OperationPatterns 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 Operation to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(List< String> tags, String? summary, String? description, String? operationId, List<Parameter> parameters, RequestBody? requestBody, Map<String, Response> responses, List<SecurityRequirement> security, List<String> ? consumes, List<String> ? produces, bool? deprecated)) → TResult -
Available on Operation, provided by the OperationPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(List< String> tags, String? summary, String? description, String? operationId, List<Parameter> parameters, RequestBody? requestBody, Map<String, Response> responses, List<SecurityRequirement> security, List<String> ? consumes, List<String> ? produces, bool? deprecated)?) → TResult? -
Available on Operation, provided by the OperationPatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited