Encoding class abstract

A single encoding definition applied to a single schema property.

The Encoding Object is used to specify how a property within a schema should be serialized when it's part of a multipart or application/x-www-form-urlencoded request body.

Available extensions
Annotations
  • @Freezed.new(copyWith: true, equal: true, toStringOverride: true, toJson: false, fromJson: false)

Constructors

Encoding({String? contentType, @Default.new({}) Map<String, Header> headers, String? style, bool? explode, bool? allowReserved, @JsonKey.new(name: r'$ref') String? ref})
Creates an Encoding object.
const
factory
Encoding.fromJson(Map<String, dynamic> json)
Creates an Encoding from a JSON object.
factory

Properties

allowReserved bool?
When this is true, parameter values are serialized using reserved expansion as defined by RFC6570.
no setterinherited
contentType String?
The Content-Type for encoding a specific property.
no setterinherited
copyWith → $EncodingCopyWith<Encoding>
Create a copy of Encoding with the given fields replaced by the non-null parameter values.
no setterinherited
explode bool?
When this is true, property values of type array or object generate separate parameters for each value.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, Header>
A map allowing additional information to be provided as headers. This field is ignored if the request body media type is not a multipart.
no setterinherited
ref String?
The reference to the Encoding Object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style String?
Describes how a specific property value will be serialized.
no setterinherited

Methods

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

Available on Encoding, provided by the EncodingPatterns extension

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

Available on Encoding, provided by the EncodingPatterns extension

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

Available on Encoding, provided by the EncodingPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String? contentType, Map<String, Header> headers, String? style, bool? explode, bool? allowReserved, String? ref)?, {required TResult orElse()}) → TResult

Available on Encoding, provided by the EncodingPatterns 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>
Converts this Encoding object to a JSON map.
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String? contentType, Map<String, Header> headers, String? style, bool? explode, bool? allowReserved, String? ref)) → TResult

Available on Encoding, provided by the EncodingPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String? contentType, Map<String, Header> headers, String? style, bool? explode, bool? allowReserved, String? ref)?) → TResult?

Available on Encoding, provided by the EncodingPatterns extension

A variant of when that fallback to returning null

Operators

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