Skip to content

Commit

Permalink
Clean up delete template (#10144) (#17527)
Browse files Browse the repository at this point in the history
[upstream:eaded1dd2c3992e3d31fb4aaf16dffb47a7c4d40]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician committed Mar 8, 2024
1 parent e897ca4 commit 54690b5
Show file tree
Hide file tree
Showing 351 changed files with 352 additions and 356 deletions.
2 changes: 2 additions & 0 deletions .changelog/10144.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```release-note:none
```
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,13 @@ func resourceAccessContextManagerAccessLevelDelete(d *schema.ResourceData, meta
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting AccessLevel %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting AccessLevel %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,13 @@ func resourceAccessContextManagerAccessLevelConditionDelete(d *schema.ResourceDa
if err != nil {
return err
}
log.Printf("[DEBUG] Deleting AccessLevelCondition %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting AccessLevelCondition %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "PATCH",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,13 @@ func resourceAccessContextManagerAccessPolicyDelete(d *schema.ResourceData, meta
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting AccessPolicy %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting AccessPolicy %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,13 @@ func resourceAccessContextManagerAuthorizedOrgsDescDelete(d *schema.ResourceData
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting AuthorizedOrgsDesc %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting AuthorizedOrgsDesc %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ func resourceAccessContextManagerEgressPolicyDelete(d *schema.ResourceData, meta
if err != nil {
return err
}
log.Printf("[DEBUG] Deleting EgressPolicy %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting EgressPolicy %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "PATCH",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,13 @@ func resourceAccessContextManagerGcpUserAccessBindingDelete(d *schema.ResourceDa
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting GcpUserAccessBinding %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting GcpUserAccessBinding %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ func resourceAccessContextManagerIngressPolicyDelete(d *schema.ResourceData, met
if err != nil {
return err
}
log.Printf("[DEBUG] Deleting IngressPolicy %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting IngressPolicy %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "PATCH",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1191,13 +1191,13 @@ func resourceAccessContextManagerServicePerimeterDelete(d *schema.ResourceData,
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting ServicePerimeter %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting ServicePerimeter %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,13 @@ func resourceAccessContextManagerServicePerimeterEgressPolicyDelete(d *schema.Re
if err != nil {
return err
}
log.Printf("[DEBUG] Deleting ServicePerimeterEgressPolicy %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting ServicePerimeterEgressPolicy %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "PATCH",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,13 @@ func resourceAccessContextManagerServicePerimeterIngressPolicyDelete(d *schema.R
if err != nil {
return err
}
log.Printf("[DEBUG] Deleting ServicePerimeterIngressPolicy %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting ServicePerimeterIngressPolicy %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "PATCH",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,13 @@ func resourceAccessContextManagerServicePerimeterResourceDelete(d *schema.Resour
if err != nil {
return err
}
log.Printf("[DEBUG] Deleting ServicePerimeterResource %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting ServicePerimeterResource %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "PATCH",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,13 @@ func resourceActiveDirectoryDomainDelete(d *schema.ResourceData, meta interface{
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting Domain %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting Domain %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
2 changes: 1 addition & 1 deletion google/services/alloydb/resource_alloydb_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,13 +636,13 @@ func resourceAlloydbBackupDelete(d *schema.ResourceData, meta interface{}) error
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting Backup %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting Backup %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
2 changes: 1 addition & 1 deletion google/services/alloydb/resource_alloydb_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1219,13 +1219,13 @@ func resourceAlloydbClusterDelete(d *schema.ResourceData, meta interface{}) erro
if deletionPolicy := d.Get("deletion_policy"); deletionPolicy == "FORCE" {
url = url + "?force=true"
}
log.Printf("[DEBUG] Deleting Cluster %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting Cluster %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
2 changes: 1 addition & 1 deletion google/services/alloydb/resource_alloydb_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,13 +703,13 @@ func resourceAlloydbInstanceDelete(d *schema.ResourceData, meta interface{}) err
log.Printf("[WARNING] This operation didn't delete the Secondary Instance %q. Please delete the associated Secondary Cluster as well to delete the entire cluster and the secondary instance.\n", d.Id())
return nil
}
log.Printf("[DEBUG] Deleting Instance %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting Instance %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
2 changes: 1 addition & 1 deletion google/services/alloydb/resource_alloydb_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,13 @@ func resourceAlloydbUserDelete(d *schema.ResourceData, meta interface{}) error {
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting User %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting User %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
2 changes: 1 addition & 1 deletion google/services/apigee/resource_apigee_addons_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,13 @@ func resourceApigeeAddonsConfigDelete(d *schema.ResourceData, meta interface{})
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting AddonsConfig %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting AddonsConfig %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ func resourceApigeeEndpointAttachmentDelete(d *schema.ResourceData, meta interfa
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting EndpointAttachment %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting EndpointAttachment %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
2 changes: 1 addition & 1 deletion google/services/apigee/resource_apigee_env_keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ func resourceApigeeEnvKeystoreDelete(d *schema.ResourceData, meta interface{}) e
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting EnvKeystore %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting EnvKeystore %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
2 changes: 1 addition & 1 deletion google/services/apigee/resource_apigee_env_references.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,13 @@ func resourceApigeeEnvReferencesDelete(d *schema.ResourceData, meta interface{})
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting EnvReferences %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting EnvReferences %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
2 changes: 1 addition & 1 deletion google/services/apigee/resource_apigee_envgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@ func resourceApigeeEnvgroupDelete(d *schema.ResourceData, meta interface{}) erro
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting Envgroup %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting Envgroup %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ func resourceApigeeEnvgroupAttachmentDelete(d *schema.ResourceData, meta interfa
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting EnvgroupAttachment %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting EnvgroupAttachment %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
2 changes: 1 addition & 1 deletion google/services/apigee/resource_apigee_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,13 @@ func resourceApigeeEnvironmentDelete(d *schema.ResourceData, meta interface{}) e
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting Environment %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting Environment %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
2 changes: 1 addition & 1 deletion google/services/apigee/resource_apigee_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,13 @@ func resourceApigeeInstanceDelete(d *schema.ResourceData, meta interface{}) erro
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting Instance %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting Instance %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ func resourceApigeeInstanceAttachmentDelete(d *schema.ResourceData, meta interfa
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting InstanceAttachment %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting InstanceAttachment %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,13 @@ func resourceApigeeKeystoresAliasesSelfSignedCertDelete(d *schema.ResourceData,
}

var obj map[string]interface{}
log.Printf("[DEBUG] Deleting KeystoresAliasesSelfSignedCert %q", d.Id())

// err == nil indicates that the billing_project value was found
if bp, err := tpgresource.GetBillingProject(d, config); err == nil {
billingProject = bp
}

log.Printf("[DEBUG] Deleting KeystoresAliasesSelfSignedCert %q", d.Id())
res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: config,
Method: "DELETE",
Expand Down

0 comments on commit 54690b5

Please sign in to comment.