Operation class abstract

Describes a single API operation on a Path.

https://swagger.io/specification/#operation-object

Available extensions
Annotations
  • @freezed

Constructors

Operation({List<String>? tags, String? summary, String? description, ExternalDocs? externalDocs, @JsonKey.new(name: 'operationId') String? id, List<Parameter>? parameters, RequestBody? requestBody, Map<String, Response>? responses, Map<String, ApiCallback>? callbacks, bool? deprecated, List<Security>? security, List<Server>? servers})
const
factory
Operation.fromJson(Map<String, dynamic> json)
factory

Properties

callbacks → Map<String, ApiCallback>?
A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the ApiCallback Object.
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?
Declares this operation to be deprecated.
no setterinherited
description → String?
An optional string describing the host designated by the URL.
no setterinherited
externalDocs → ExternalDocs?
Additional external documentation for this schema.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
id → String?
Unique string used to identify the operation. The id MUST be unique among all operations described in the API.
no setterinherited
parameters → List<Parameter>?
A list of parameters that are applicable for this operation. If a parameter is already defined at the PathItem level, the new definition will override it but can never remove it.
no setterinherited
requestBody → RequestBody?
The request body applicable for this operation.
no setterinherited
responses → Map<String, Response>?
The list of possible responses as they are returned from executing this operation.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
security → List<Security>?
A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used.
no setterinherited
servers → List<Server>?
An alternative Server array to service this operation. If an alternative Server object is specified at the PathItem level, it will be overridden by this value.
no setterinherited
summary → String?
A short summary of what the operation does.
no setterinherited
tags → List<String>?
A list of tags for API documentation control.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_Operation value)) → TResult

Available on Operation, provided by the OperationPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_Operation value)?) → TResult?

Available on Operation, provided by the OperationPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_Operation value)?, {required TResult orElse()}) → TResult

Available on Operation, provided by the OperationPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(List<String>? tags, String? summary, String? description, ExternalDocs? externalDocs, String? id, List<Parameter>? parameters, RequestBody? requestBody, Map<String, Response>? responses, Map<String, ApiCallback>? callbacks, bool? deprecated, List<Security>? security, List<Server>? servers)?, {required TResult orElse()}) → TResult

Available on Operation, provided by the OperationPatterns extension

A variant of when that fallback to an orElse callback.
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, ExternalDocs? externalDocs, String? id, List<Parameter>? parameters, RequestBody? requestBody, Map<String, Response>? responses, Map<String, ApiCallback>? callbacks, bool? deprecated, List<Security>? security, List<Server>? servers)) → TResult

Available on Operation, provided by the OperationPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(List<String>? tags, String? summary, String? description, ExternalDocs? externalDocs, String? id, List<Parameter>? parameters, RequestBody? requestBody, Map<String, Response>? responses, Map<String, ApiCallback>? callbacks, bool? deprecated, List<Security>? security, List<Server>? servers)?) → TResult?

Available on Operation, provided by the OperationPatterns extension

A variant of when that fallback to returning null

Operators

operator ==(Object other) → bool
The equality operator.
inherited