fromJson static method

Variable fromJson(
  1. dynamic value
)

Returns a new Variable instance and imports

Implementation

// ignore: prefer_constructors_over_static_methods
static Variable fromJson(dynamic value) {
  final json = value.cast<String, dynamic>();
  return Variable(
    links: json[r'links'] == null
        ? null
        : VariableLinks.fromJson(json[r'links']),
    id: mapValueOfType<String>(json, r'id'),
    orgID: mapValueOfType<String>(json, r'orgID'),
    name: mapValueOfType<String>(json, r'name'),
    description: mapValueOfType<String>(json, r'description'),
    selected: json[r'selected'] is List
        ? (json[r'selected'] as List).cast<String>()
        : null,
    labels: Label.listFromJson(json[r'labels']),
    arguments: json[r'arguments'] == null
        ? null
        : VariableProperties.fromJson(json[r'arguments']),
    createdAt: mapDateTime(json, r'createdAt', ''),
    updatedAt: mapDateTime(json, r'updatedAt', ''),
  );
}