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

replace dropped Bool func with RefOf func #208

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions opslevel/resource_opslevel_check_custom_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func resourceCheckCustomEventCreate(d *schema.ResourceData, client *opslevel.Cli
input := opslevel.NewCheckCreateInputTypeOf[opslevel.CheckCustomEventCreateInput](checkCreateInput)

input.IntegrationId = *opslevel.NewID(d.Get("integration").(string))
input.PassPending = opslevel.Bool(d.Get("pass_pending").(bool))
input.PassPending = opslevel.RefOf(d.Get("pass_pending").(bool))
input.ServiceSelector = d.Get("service_selector").(string)
input.SuccessCondition = d.Get("success_condition").(string)
input.ResultMessage = opslevel.RefOf(d.Get("message").(string))
Expand Down Expand Up @@ -114,7 +114,7 @@ func resourceCheckCustomEventUpdate(d *schema.ResourceData, client *opslevel.Cli
if d.HasChange("integration") {
input.IntegrationId = opslevel.NewID(d.Get("integration").(string))
}
input.PassPending = opslevel.Bool(d.Get("pass_pending").(bool))
input.PassPending = opslevel.RefOf(d.Get("pass_pending").(bool))
if d.HasChange("service_selector") {
input.ServiceSelector = opslevel.RefOf(d.Get("service_selector").(string))
}
Expand Down
2 changes: 1 addition & 1 deletion opslevel/resource_opslevel_check_has_recent_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func resourceCheckHasRecentDeployUpdate(d *schema.ResourceData, client *opslevel
checkUpdateInput := getCheckUpdateInputFrom(d)
input := opslevel.NewCheckUpdateInputTypeOf[opslevel.CheckHasRecentDeployUpdateInput](checkUpdateInput)
if d.HasChange("days") {
input.Days = opslevel.NewInt(d.Get("days").(int))
input.Days = opslevel.RefOf(d.Get("days").(int))
}

_, err := client.UpdateCheckHasRecentDeploy(*input)
Expand Down
4 changes: 2 additions & 2 deletions opslevel/resource_opslevel_check_service_ownership.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func resourceCheckServiceOwnershipCreate(d *schema.ResourceData, client *opsleve
checkCreateInput := getCheckCreateInputFrom(d)
input := opslevel.NewCheckCreateInputTypeOf[opslevel.CheckServiceOwnershipCreateInput](checkCreateInput)

input.RequireContactMethod = opslevel.Bool(d.Get("require_contact_method").(bool))
input.RequireContactMethod = opslevel.RefOf(d.Get("require_contact_method").(bool))
if value, ok := d.GetOk("contact_method"); ok {
contactMethod := opslevel.ContactType(value.(string))
input.ContactMethod = opslevel.RefOf(string(contactMethod))
Expand Down Expand Up @@ -103,7 +103,7 @@ func resourceCheckServiceOwnershipRead(d *schema.ResourceData, client *opslevel.
func resourceCheckServiceOwnershipUpdate(d *schema.ResourceData, client *opslevel.Client) error {
checkUpdateInput := getCheckUpdateInputFrom(d)
input := opslevel.NewCheckUpdateInputTypeOf[opslevel.CheckServiceOwnershipUpdateInput](checkUpdateInput)
input.RequireContactMethod = opslevel.Bool(d.Get("require_contact_method").(bool))
input.RequireContactMethod = opslevel.RefOf(d.Get("require_contact_method").(bool))

if d.HasChange("contact_method") {
contactMethod := opslevel.ContactType(d.Get("contact_method").(string))
Expand Down
4 changes: 2 additions & 2 deletions opslevel/resource_opslevel_integration_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func resourceIntegrationAWSCreate(d *schema.ResourceData, client *opslevel.Clien
Name: opslevel.RefOf(d.Get("name").(string)),
IAMRole: opslevel.RefOf(d.Get("iam_role").(string)),
ExternalID: opslevel.RefOf(d.Get("external_id").(string)),
OwnershipTagOverride: opslevel.Bool(d.Get("ownership_tag_overrides").(bool)),
OwnershipTagOverride: opslevel.RefOf(d.Get("ownership_tag_overrides").(bool)),
}

input.OwnershipTagKeys = getStringArray(d, "ownership_tag_keys")
Expand Down Expand Up @@ -106,7 +106,7 @@ func resourceIntegrationAWSUpdate(d *schema.ResourceData, client *opslevel.Clien
Name: opslevel.RefOf(d.Get("name").(string)),
IAMRole: opslevel.RefOf(d.Get("iam_role").(string)),
ExternalID: opslevel.RefOf(d.Get("external_id").(string)),
OwnershipTagOverride: opslevel.Bool(d.Get("ownership_tag_overrides").(bool)),
OwnershipTagOverride: opslevel.RefOf(d.Get("ownership_tag_overrides").(bool)),
}

input.OwnershipTagKeys = getStringArray(d, "ownership_tag_keys")
Expand Down
2 changes: 1 addition & 1 deletion opslevel/resource_opslevel_scorecard.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func handleInput(d *schema.ResourceData) opslevel.ScorecardInput {
OwnerId: *opslevel.NewID(d.Get("owner_id").(string)),
Description: &description,
FilterId: opslevel.NewID(d.Get("filter_id").(string)),
AffectsOverallServiceLevels: opslevel.Bool(d.Get("affects_overall_service_levels").(bool)),
AffectsOverallServiceLevels: opslevel.RefOf(d.Get("affects_overall_service_levels").(bool)),
}

return input
Expand Down
4 changes: 2 additions & 2 deletions opslevel/resource_opslevel_trigger_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func resourceTriggerDefinitionCreate(d *schema.ResourceData, client *opslevel.Cl
input.ResponseTemplate = opslevel.RefOf(responseTemplate)
}

input.Published = opslevel.Bool(d.Get("published").(bool))
input.Published = opslevel.RefOf(d.Get("published").(bool))

if _, ok := d.GetOk("entity_type"); ok {
entityType := d.Get("entity_type").(string)
Expand Down Expand Up @@ -217,7 +217,7 @@ func resourceTriggerDefinitionUpdate(d *schema.ResourceData, client *opslevel.Cl
input.FilterId = opslevel.NewID(d.Get("filter").(string))
}

input.Published = opslevel.Bool(d.Get("published").(bool))
input.Published = opslevel.RefOf(d.Get("published").(bool))

if d.HasChange("access_control") {
input.AccessControl = opslevel.RefOf(opslevel.CustomActionsTriggerDefinitionAccessControlEnum(d.Get("access_control").(string)))
Expand Down
2 changes: 1 addition & 1 deletion opslevel/schema_checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func setCheckUpdateInput(d *schema.ResourceData, p opslevel.CheckUpdateInputProv
if d.HasChange("name") {
input.Name = d.Get("name").(string)
}
input.Enabled = opslevel.Bool(d.Get("enabled").(bool))
input.Enabled = opslevel.RefOf(d.Get("enabled").(bool))
if d.HasChange("enable_on") {
enable_on := opslevel.NewISO8601Date(d.Get("enable_on").(string))
input.EnableOn = &enable_on
Expand Down
Loading