Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
hesto2 committed Aug 5, 2024
1 parent 6a1636c commit c145a6d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions jupiterone/resource_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ func (r *DashboardResource) Read(ctx context.Context, req resource.ReadRequest,
dashboard, err := client.GetDashboard(ctx, r.qlient, data.Id.ValueString())
if err != nil {
if strings.Contains(err.Error(), "not found") {
resp.State.RemoveResource(ctx)
resp.State.RemoveResource(ctx)
} else {
resp.Diagnostics.AddError("failed to get dashboard", err.Error())
resp.Diagnostics.AddError("failed to get dashboard", err.Error())
}
return
}
Expand Down
4 changes: 2 additions & 2 deletions jupiterone/resource_framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ func (r *ComplianceFrameworkResource) Read(ctx context.Context, req resource.Rea
if r, err := client.GetComplianceFrameworkById(ctx, r.qlient, data.Id.ValueString()); err != nil {
if err != nil {
if strings.Contains(err.Error(), "Could not find") {
resp.State.RemoveResource(ctx)
resp.State.RemoveResource(ctx)
} else {
resp.Diagnostics.AddError("failed to find framework", err.Error())
resp.Diagnostics.AddError("failed to find framework", err.Error())
}
}
return
Expand Down
4 changes: 2 additions & 2 deletions jupiterone/resource_frameworkitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ func (r *ComplianceFrameworkItemResource) Read(ctx context.Context, req resource
if r, err := client.GetComplianceFrameworkItemById(ctx, r.qlient, data.Id.ValueString()); err != nil {
if err != nil {
if strings.Contains(err.Error(), "Could not find") {
resp.State.RemoveResource(ctx)
resp.State.RemoveResource(ctx)
} else {
resp.Diagnostics.AddError("failed to find framework item", err.Error())
resp.Diagnostics.AddError("failed to find framework item", err.Error())
}
}
return
Expand Down
4 changes: 2 additions & 2 deletions jupiterone/resource_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ func (r *ComplianceGroupResource) Read(ctx context.Context, req resource.ReadReq
if err != nil {
if err != nil {
if strings.Contains(err.Error(), "Could not find") {
resp.State.RemoveResource(ctx)
resp.State.RemoveResource(ctx)
} else {
resp.Diagnostics.AddError("failed to find group", err.Error())
resp.Diagnostics.AddError("failed to find group", err.Error())
}
}
return
Expand Down
4 changes: 2 additions & 2 deletions jupiterone/resource_libraryitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ func (r *ComplianceLibraryItemResource) Read(ctx context.Context, req resource.R
if r, err := client.GetComplianceLibraryItemById(ctx, r.qlient, data.Id.ValueString()); err != nil {
if err != nil {
if strings.Contains(err.Error(), "Could not find") {
resp.State.RemoveResource(ctx)
resp.State.RemoveResource(ctx)
} else {
resp.Diagnostics.AddError("failed to find library item", err.Error())
resp.Diagnostics.AddError("failed to find library item", err.Error())
}
}
return
Expand Down
4 changes: 2 additions & 2 deletions jupiterone/resource_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,9 @@ func (r *QuestionRuleResource) Read(ctx context.Context, req resource.ReadReques
getResp, err := client.GetQuestionRuleInstance(ctx, r.qlient, oldData.Id.ValueString())
if err != nil {
if strings.Contains(err.Error(), "does not exist") {
resp.State.RemoveResource(ctx)
resp.State.RemoveResource(ctx)
} else {
resp.Diagnostics.AddError("failed to get rule", err.Error())
resp.Diagnostics.AddError("failed to get rule", err.Error())
}
return
}
Expand Down
4 changes: 2 additions & 2 deletions jupiterone/resource_widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ func (r *WidgetResource) Read(ctx context.Context, req resource.ReadRequest, res
response, err := client.GetWidget(ctx, r.qlient, data.DashboardId.ValueString(), "Account", data.Id.ValueString())
if err != nil {
if strings.Contains(err.Error(), "not found") {
resp.State.RemoveResource(ctx)
resp.State.RemoveResource(ctx)
} else {
resp.Diagnostics.AddError("failed to get widget", err.Error())
resp.Diagnostics.AddError("failed to get widget", err.Error())
}
return
}
Expand Down

0 comments on commit c145a6d

Please sign in to comment.