in service/networkflowmonitor/deserializers.go [4810:5064]
func awsRestjson1_deserializeDocumentMonitorTopContributorsRow(v **types.MonitorTopContributorsRow, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MonitorTopContributorsRow
if *v == nil {
sv = &types.MonitorTopContributorsRow{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "destinationCategory":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DestinationCategory to be of type string, got %T instead", value)
}
sv.DestinationCategory = types.DestinationCategory(jtv)
}
case "dnatIp":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DnatIp = ptr.String(jtv)
}
case "kubernetesMetadata":
if err := awsRestjson1_deserializeDocumentKubernetesMetadata(&sv.KubernetesMetadata, value); err != nil {
return err
}
case "localAz":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AvailabilityZone to be of type string, got %T instead", value)
}
sv.LocalAz = ptr.String(jtv)
}
case "localInstanceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceArn to be of type string, got %T instead", value)
}
sv.LocalInstanceArn = ptr.String(jtv)
}
case "localInstanceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value)
}
sv.LocalInstanceId = ptr.String(jtv)
}
case "localIp":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LocalIp = ptr.String(jtv)
}
case "localRegion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AwsRegion to be of type string, got %T instead", value)
}
sv.LocalRegion = ptr.String(jtv)
}
case "localSubnetArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubnetArn to be of type string, got %T instead", value)
}
sv.LocalSubnetArn = ptr.String(jtv)
}
case "localSubnetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubnetId to be of type string, got %T instead", value)
}
sv.LocalSubnetId = ptr.String(jtv)
}
case "localVpcArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VpcArn to be of type string, got %T instead", value)
}
sv.LocalVpcArn = ptr.String(jtv)
}
case "localVpcId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VpcId to be of type string, got %T instead", value)
}
sv.LocalVpcId = ptr.String(jtv)
}
case "remoteAz":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AvailabilityZone to be of type string, got %T instead", value)
}
sv.RemoteAz = ptr.String(jtv)
}
case "remoteInstanceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceArn to be of type string, got %T instead", value)
}
sv.RemoteInstanceArn = ptr.String(jtv)
}
case "remoteInstanceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value)
}
sv.RemoteInstanceId = ptr.String(jtv)
}
case "remoteIp":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.RemoteIp = ptr.String(jtv)
}
case "remoteRegion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AwsRegion to be of type string, got %T instead", value)
}
sv.RemoteRegion = ptr.String(jtv)
}
case "remoteSubnetArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubnetArn to be of type string, got %T instead", value)
}
sv.RemoteSubnetArn = ptr.String(jtv)
}
case "remoteSubnetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubnetId to be of type string, got %T instead", value)
}
sv.RemoteSubnetId = ptr.String(jtv)
}
case "remoteVpcArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VpcArn to be of type string, got %T instead", value)
}
sv.RemoteVpcArn = ptr.String(jtv)
}
case "remoteVpcId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VpcId to be of type string, got %T instead", value)
}
sv.RemoteVpcId = ptr.String(jtv)
}
case "snatIp":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SnatIp = ptr.String(jtv)
}
case "targetPort":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TargetPort = ptr.Int32(int32(i64))
}
case "traversedConstructs":
if err := awsRestjson1_deserializeDocumentTraversedConstructsList(&sv.TraversedConstructs, value); err != nil {
return err
}
case "value":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Value = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}