Skip to content

Commit

Permalink
d/aws_sesv2_configuration_set: Cosmetics.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Dec 12, 2024
1 parent 8feed69 commit 50285ae
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions internal/service/sesv2/configuration_set_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,58 +158,53 @@ func dataSourceConfigurationSetRead(ctx context.Context, d *schema.ResourceData,

name := d.Get("configuration_set_name").(string)

out, err := findConfigurationSetByID(ctx, conn, name)
output, err := findConfigurationSetByID(ctx, conn, name)

if err != nil {
return create.AppendDiagError(diags, names.SESV2, create.ErrActionReading, dsNameConfigurationSet, name, err)
}

d.SetId(aws.ToString(out.ConfigurationSetName))

d.Set(names.AttrARN, configurationSetARN(ctx, meta.(*conns.AWSClient), aws.ToString(out.ConfigurationSetName)))
d.Set("configuration_set_name", out.ConfigurationSetName)
d.SetId(aws.ToString(output.ConfigurationSetName))

if out.DeliveryOptions != nil {
if err := d.Set("delivery_options", []interface{}{flattenDeliveryOptions(out.DeliveryOptions)}); err != nil {
d.Set(names.AttrARN, configurationSetARN(ctx, meta.(*conns.AWSClient), aws.ToString(output.ConfigurationSetName)))
d.Set("configuration_set_name", output.ConfigurationSetName)
if output.DeliveryOptions != nil {
if err := d.Set("delivery_options", []interface{}{flattenDeliveryOptions(output.DeliveryOptions)}); err != nil {
return create.AppendDiagError(diags, names.SESV2, create.ErrActionSetting, dsNameConfigurationSet, d.Id(), err)
}
} else {
d.Set("delivery_options", nil)
}

if out.ReputationOptions != nil {
if err := d.Set("reputation_options", []interface{}{flattenReputationOptions(out.ReputationOptions)}); err != nil {
if output.ReputationOptions != nil {
if err := d.Set("reputation_options", []interface{}{flattenReputationOptions(output.ReputationOptions)}); err != nil {
return create.AppendDiagError(diags, names.SESV2, create.ErrActionSetting, dsNameConfigurationSet, d.Id(), err)
}
} else {
d.Set("reputation_options", nil)
}

if out.SendingOptions != nil {
if err := d.Set("sending_options", []interface{}{flattenSendingOptions(out.SendingOptions)}); err != nil {
if output.SendingOptions != nil {
if err := d.Set("sending_options", []interface{}{flattenSendingOptions(output.SendingOptions)}); err != nil {
return create.AppendDiagError(diags, names.SESV2, create.ErrActionSetting, dsNameConfigurationSet, d.Id(), err)
}
} else {
d.Set("sending_options", nil)
}

if out.SuppressionOptions != nil {
if err := d.Set("suppression_options", []interface{}{flattenSuppressionOptions(out.SuppressionOptions)}); err != nil {
if output.SuppressionOptions != nil {
if err := d.Set("suppression_options", []interface{}{flattenSuppressionOptions(output.SuppressionOptions)}); err != nil {
return create.AppendDiagError(diags, names.SESV2, create.ErrActionSetting, dsNameConfigurationSet, d.Id(), err)
}
} else {
d.Set("suppression_options", nil)
}

if out.TrackingOptions != nil {
if err := d.Set("tracking_options", []interface{}{flattenTrackingOptions(out.TrackingOptions)}); err != nil {
if output.TrackingOptions != nil {
if err := d.Set("tracking_options", []interface{}{flattenTrackingOptions(output.TrackingOptions)}); err != nil {
return create.AppendDiagError(diags, names.SESV2, create.ErrActionSetting, dsNameConfigurationSet, d.Id(), err)
}
} else {
d.Set("tracking_options", nil)
}

if out.VdmOptions != nil {
if err := d.Set("vdm_options", []interface{}{flattenVDMOptions(out.VdmOptions)}); err != nil {
if output.VdmOptions != nil {
if err := d.Set("vdm_options", []interface{}{flattenVDMOptions(output.VdmOptions)}); err != nil {
return create.AppendDiagError(diags, names.SESV2, create.ErrActionSetting, dsNameConfigurationSet, d.Id(), err)
}
} else {
Expand Down

0 comments on commit 50285ae

Please sign in to comment.