GameServerGroup.fromJson constructor

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

Implementation

factory GameServerGroup.fromJson(Map<String, dynamic> json) {
  return GameServerGroup(
    autoScalingGroupArn: json['AutoScalingGroupArn'] as String?,
    balancingStrategy:
        (json['BalancingStrategy'] as String?)?.toBalancingStrategy(),
    creationTime: timeStampFromJson(json['CreationTime']),
    gameServerGroupArn: json['GameServerGroupArn'] as String?,
    gameServerGroupName: json['GameServerGroupName'] as String?,
    gameServerProtectionPolicy:
        (json['GameServerProtectionPolicy'] as String?)
            ?.toGameServerProtectionPolicy(),
    instanceDefinitions: (json['InstanceDefinitions'] as List?)
        ?.whereNotNull()
        .map((e) => InstanceDefinition.fromJson(e as Map<String, dynamic>))
        .toList(),
    lastUpdatedTime: timeStampFromJson(json['LastUpdatedTime']),
    roleArn: json['RoleArn'] as String?,
    status: (json['Status'] as String?)?.toGameServerGroupStatus(),
    statusReason: json['StatusReason'] as String?,
    suspendedActions: (json['SuspendedActions'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toGameServerGroupAction())
        .toList(),
  );
}