App.fromJson constructor

App.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory App.fromJson(Map<String, dynamic> json) {
  return App(
    appId: json['AppId'] as String?,
    appSource: json['AppSource'] != null
        ? Source.fromJson(json['AppSource'] as Map<String, dynamic>)
        : null,
    attributes: (json['Attributes'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k.toAppAttributesKeys(), e as String)),
    createdAt: json['CreatedAt'] as String?,
    dataSources: (json['DataSources'] as List?)
        ?.whereNotNull()
        .map((e) => DataSource.fromJson(e as Map<String, dynamic>))
        .toList(),
    description: json['Description'] as String?,
    domains: (json['Domains'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    enableSsl: json['EnableSsl'] as bool?,
    environment: (json['Environment'] as List?)
        ?.whereNotNull()
        .map((e) => EnvironmentVariable.fromJson(e as Map<String, dynamic>))
        .toList(),
    name: json['Name'] as String?,
    shortname: json['Shortname'] as String?,
    sslConfiguration: json['SslConfiguration'] != null
        ? SslConfiguration.fromJson(
            json['SslConfiguration'] as Map<String, dynamic>)
        : null,
    stackId: json['StackId'] as String?,
    type: (json['Type'] as String?)?.toAppType(),
  );
}