Link class abstract

A Link Object represents a possible design-time link for a response.

The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.

Available extensions
Annotations
  • @freezed

Constructors

Link.new({String? operationRef, String? operationId, Map<String, dynamic>? parameters, dynamic requestBody, String? description, Server? server})
Creates a Link object.
const
factory
Link.fromJson(Map<String, dynamic> json)
Creates a Link from a JSON object.
factory

Properties

copyWith → $LinkCopyWith<Link>
Create a copy of Link with the given fields replaced by the non-null parameter values.
no setterinherited
description String?
A description of the link.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
operationId String?
The name of an existing, resolvable OAS operation, as defined with a unique operationId. This field is mutually exclusive with the operationRef field.
no setterinherited
operationRef String?
A URI reference to an OAS operation. This field is mutually exclusive with the operationId field.
no setterinherited
parameters Map<String, dynamic>?
A map representing parameters to pass to an operation. The key is the parameter name, and the value is a constant or an expression.
no setterinherited
requestBody → dynamic
A literal value or an expression to use as a request body when calling the target operation.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
server Server?
A server object to be used by the target operation.
no setterinherited

Methods

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

Available on Link, provided by the LinkPatterns extension

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

Available on Link, provided by the LinkPatterns extension

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

Available on Link, provided by the LinkPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String? operationRef, String? operationId, Map<String, dynamic>? parameters, dynamic requestBody, String? description, Server? server)?, {required TResult orElse()}) → TResult

Available on Link, provided by the LinkPatterns 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 Link to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String? operationRef, String? operationId, Map<String, dynamic>? parameters, dynamic requestBody, String? description, Server? server)) → TResult

Available on Link, provided by the LinkPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String? operationRef, String? operationId, Map<String, dynamic>? parameters, dynamic requestBody, String? description, Server? server)?) → TResult?

Available on Link, provided by the LinkPatterns extension

A variant of when that fallback to returning null

Operators

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