Function$.fromJson constructor

Function$.fromJson(
  1. Object? j
)

Implementation

factory Function$.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Function$(
    name: switch (json['name']) {
      null => '',
      Object $1 => decodeString($1),
    },
    description: switch (json['description']) {
      null => '',
      Object $1 => decodeString($1),
    },
    buildConfig: switch (json['buildConfig']) {
      null => null,
      Object $1 => BuildConfig.fromJson($1),
    },
    serviceConfig: switch (json['serviceConfig']) {
      null => null,
      Object $1 => ServiceConfig.fromJson($1),
    },
    eventTrigger: switch (json['eventTrigger']) {
      null => null,
      Object $1 => EventTrigger.fromJson($1),
    },
    state: switch (json['state']) {
      null => Function$_State.$default,
      Object $1 => Function$_State.fromJson($1),
    },
    updateTime: switch (json['updateTime']) {
      null => null,
      Object $1 => Timestamp.fromJson($1),
    },
    labels: switch (json['labels']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): decodeString(e.value),
      },
      _ => throw const FormatException('"labels" is not an object'),
    },
    stateMessages: switch (json['stateMessages']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) StateMessage.fromJson(i)],
      _ => throw const FormatException('"stateMessages" is not a list'),
    },
    environment: switch (json['environment']) {
      null => Environment.$default,
      Object $1 => Environment.fromJson($1),
    },
    url: switch (json['url']) {
      null => '',
      Object $1 => decodeString($1),
    },
    kmsKeyName: switch (json['kmsKeyName']) {
      null => '',
      Object $1 => decodeString($1),
    },
    satisfiesPzs: switch (json['satisfiesPzs']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    createTime: switch (json['createTime']) {
      null => null,
      Object $1 => Timestamp.fromJson($1),
    },
  );
}