in service/timestreaminfluxdb/deserializers.go [5289:5503]
func awsAwsjson10_deserializeOpDocumentUpdateDbInstanceOutput(v **UpdateDbInstanceOutput, 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 *UpdateDbInstanceOutput
if *v == nil {
sv = &UpdateDbInstanceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "allocatedStorage":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected AllocatedStorage to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.AllocatedStorage = ptr.Int32(int32(i64))
}
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "availabilityZone":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.AvailabilityZone = ptr.String(jtv)
}
case "dbClusterId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DbClusterId to be of type string, got %T instead", value)
}
sv.DbClusterId = ptr.String(jtv)
}
case "dbInstanceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DbInstanceType to be of type string, got %T instead", value)
}
sv.DbInstanceType = types.DbInstanceType(jtv)
}
case "dbParameterGroupIdentifier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DbParameterGroupIdentifier to be of type string, got %T instead", value)
}
sv.DbParameterGroupIdentifier = ptr.String(jtv)
}
case "dbStorageType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DbStorageType to be of type string, got %T instead", value)
}
sv.DbStorageType = types.DbStorageType(jtv)
}
case "deploymentType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeploymentType to be of type string, got %T instead", value)
}
sv.DeploymentType = types.DeploymentType(jtv)
}
case "endpoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Endpoint = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DbInstanceId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "influxAuthParametersSecretArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.InfluxAuthParametersSecretArn = ptr.String(jtv)
}
case "instanceMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceMode to be of type string, got %T instead", value)
}
sv.InstanceMode = types.InstanceMode(jtv)
}
case "logDeliveryConfiguration":
if err := awsAwsjson10_deserializeDocumentLogDeliveryConfiguration(&sv.LogDeliveryConfiguration, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DbInstanceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "networkType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NetworkType to be of type string, got %T instead", value)
}
sv.NetworkType = types.NetworkType(jtv)
}
case "port":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Port = ptr.Int32(int32(i64))
}
case "publiclyAccessible":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.PubliclyAccessible = ptr.Bool(jtv)
}
case "secondaryAvailabilityZone":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SecondaryAvailabilityZone = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Status to be of type string, got %T instead", value)
}
sv.Status = types.Status(jtv)
}
case "vpcSecurityGroupIds":
if err := awsAwsjson10_deserializeDocumentVpcSecurityGroupIdList(&sv.VpcSecurityGroupIds, value); err != nil {
return err
}
case "vpcSubnetIds":
if err := awsAwsjson10_deserializeDocumentVpcSubnetIdList(&sv.VpcSubnetIds, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}