Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resources connection #26

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Resources connection #26

wants to merge 8 commits into from

Conversation

chkp-omerma
Copy link
Contributor

No description provided.

}

webAPIAssert := webAPIAssetModels.UpdateWebAPIAssetInput{
RemovePracticeWrappers: []string{d.Id()},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove profiles

@@ -54,6 +54,13 @@ func NewDockerProfile(ctx context.Context, c *api.Client, input models.CreateDoc
key
value
}
usedBy {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove from query

@@ -97,6 +97,13 @@ func NewAppSecGatewayProfile(ctx context.Context, c *api.Client, input models.Cr
key
value
}
usedBy {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove from query

return utils.DiagError("failed get WebAPIAsset before update", err, diags)
}

webAPIAssert := webAPIAssetModels.UpdateWebAPIAssetInput{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo asset

@@ -223,6 +227,56 @@ func resourceEmbeddedProfileDelete(ctx context.Context, d *schema.ResourceData,
var diags diag.Diagnostics
c := meta.(*api.Client)

profile, err := embeddedprofile.GetEmbeddedProfile(ctx, c, d.Id())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put in a function for clarity

return utils.DiagError("failed to update usedByResource", err, diags)
}
}

ID := d.Id()
result, err := embeddedprofile.DeleteEmbeddedProfile(ctx, c, ID)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search for references only if there's an error of object used by another object

return utils.DiagError("unable to perform ExceptionBehavior Delete", err, diags)
}

if usedBy != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| len(usedBy) > 0


switch usedByResource.SubType {
case "WebAPI":
objectToUpdate, err := webapiasset.GetWebAPIAsset(ctx, c, usedByResource.ID)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove Get call and used usedByResource.ID for update

// return utils.DiagError("failed to prepare asset to update", err, diags)
// }
//
// updated, err := webapiasset.UpdateWebAPIAsset(ctx, c, objectToUpdate.ID, preparedAssetToUpdate)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If and when you change the implementation of deleting a trigger from its practice wrapper instead of an asset, you should also change this update to be on the practice wrapper

// return utils.DiagError("unable to perform WebAPIAsset Delete", err, diags)
// }
//
// } else {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments about different asset types

return utils.DiagError("unable to perform WebAPIPractice Delete", err, diags)
}

fmt.Printf("usedBy: %v\n", usedBy)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@chkp-omerma chkp-omerma requested a deployment to Dev January 14, 2025 16:35 — with GitHub Actions Abandoned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant