PortMapping.fromJson constructor

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

Implementation

factory PortMapping.fromJson(Map<String, dynamic> json) {
  return PortMapping(
    acceleratorPort: json['AcceleratorPort'] as int?,
    destinationSocketAddress: json['DestinationSocketAddress'] != null
        ? SocketAddress.fromJson(
            json['DestinationSocketAddress'] as Map<String, dynamic>)
        : null,
    destinationTrafficState: (json['DestinationTrafficState'] as String?)
        ?.toCustomRoutingDestinationTrafficState(),
    endpointGroupArn: json['EndpointGroupArn'] as String?,
    endpointId: json['EndpointId'] as String?,
    protocols: (json['Protocols'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toCustomRoutingProtocol())
        .toList(),
  );
}