Skip to content

Commit

Permalink
Upgrade entire go package to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzaadi committed May 20, 2024
1 parent 51e7e6a commit 77c940a
Show file tree
Hide file tree
Showing 60 changed files with 181 additions and 181 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/port-labs/terraform-provider-port-labs
module github.com/port-labs/terraform-provider-port-labs/v2

go 1.18

Expand Down
4 changes: 2 additions & 2 deletions internal/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/hashicorp/terraform-plugin-framework/providerserver"
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
"github.com/port-labs/terraform-provider-port-labs/internal/consts"
"github.com/port-labs/terraform-provider-port-labs/provider"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/consts"
"github.com/port-labs/terraform-provider-port-labs/v2/provider"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"

"github.com/hashicorp/terraform-plugin-framework/providerserver"
"github.com/port-labs/terraform-provider-port-labs/provider"
"github.com/port-labs/terraform-provider-port-labs/v2/provider"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions port/action-permissions/actionPermissionToPortBody.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package action_permissions

import (
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func actionPermissionsToPortBody(state *PermissionsModel) (*cli.ActionPermissions, error) {
Expand Down
4 changes: 2 additions & 2 deletions port/action-permissions/refreshActionPermissionsToState.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package action_permissions
import (
"encoding/json"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/flex"
)

func refreshActionPermissionsState(state *ActionPermissionsModel, a *cli.ActionPermissions, actionId string) error {
Expand Down
2 changes: 1 addition & 1 deletion port/action-permissions/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
)

var _ resource.Resource = &ActionPermissionsResource{}
Expand Down
48 changes: 24 additions & 24 deletions port/action-permissions/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/port-labs/terraform-provider-port-labs/internal/acctest"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/acctest"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func testAccCreateBlueprintAndActionConfig(blueprintIdentifier string, actionIdentifier string) string {
Expand Down Expand Up @@ -178,13 +178,13 @@ func TestAccPortActionPermissionsWithPolicy(t *testing.T) {
permissions = {
"execute": {
"roles": [
"Member",
],
"Member",
],
"users": [],
"teams": [],
"owned_by_team": false
},
"approve": {
},
"approve": {
"roles": [],
"users": [],
"teams": [],
Expand Down Expand Up @@ -226,13 +226,13 @@ func TestAccPortActionPermissionsWithPolicy(t *testing.T) {
permissions = {
"execute": {
"roles": [
"Member",
],
"Member",
],
"users": [],
"teams": [],
"owned_by_team": false
},
"approve": {
},
"approve": {
"roles": [],
"users": [],
"teams": []
Expand Down Expand Up @@ -286,13 +286,13 @@ func TestAccPortActionPermissionsWithPolicyUpdate(t *testing.T) {
permissions = {
"execute": {
"roles": [
"Member",
],
"Member",
],
"users": [],
"teams": [],
"owned_by_team": false
},
"approve": {
},
"approve": {
"roles": [],
"users": [],
"teams": [],
Expand Down Expand Up @@ -334,13 +334,13 @@ func TestAccPortActionPermissionsWithPolicyUpdate(t *testing.T) {
permissions = {
"execute": {
"roles": [
"Member",
],
"Member",
],
"users": [],
"teams": [],
"owned_by_team": false
},
"approve": {
},
"approve": {
"roles": [],
"users": [],
"teams": [],
Expand Down Expand Up @@ -370,9 +370,9 @@ func TestAccPortActionPermissionsWithPolicyUpdate(t *testing.T) {
}
},
conditions: [
"true"]
"true"]
})
}
}
}
}`
resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -422,13 +422,13 @@ func TestAccPortActionPermissionsImportState(t *testing.T) {
permissions = {
"execute": {
"roles": [
"Member",
],
"Member",
],
"users": [],
"teams": [],
"owned_by_team": false
},
"approve": {
},
"approve": {
"roles": [],
"users": [],
"teams": [],
Expand Down
6 changes: 3 additions & 3 deletions port/action/actionStateToPortBody.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package action

import (
"context"
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/internal/consts"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/consts"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func actionDataSetToPortBody(dataSet *DatasetModel) *cli.Dataset {
Expand Down
6 changes: 3 additions & 3 deletions port/action/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func handleArrayItemsToBody(ctx context.Context, property *cli.ActionProperty, prop ArrayPropModel, required *[]string) error {
Expand Down
4 changes: 2 additions & 2 deletions port/action/boolean.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package action
import (
"context"

"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func booleanPropResourceToBody(ctx context.Context, d *SelfServiceTriggerModel, props map[string]cli.ActionProperty, required *[]string) error {
Expand Down
6 changes: 3 additions & 3 deletions port/action/number.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func numberPropResourceToBody(ctx context.Context, state *SelfServiceTriggerModel, props map[string]cli.ActionProperty, required *[]string) error {
Expand Down
6 changes: 3 additions & 3 deletions port/action/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"encoding/json"

"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func objectPropResourceToBody(ctx context.Context, d *SelfServiceTriggerModel, props map[string]cli.ActionProperty, required *[]string) error {
Expand Down
8 changes: 4 additions & 4 deletions port/action/refreshActionState.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/samber/lo"

"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/internal/consts"
"github.com/port-labs/terraform-provider-port-labs/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/consts"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func writeInvocationMethodToResource(ctx context.Context, a *cli.Action, state *ActionModel) error {
Expand Down
2 changes: 1 addition & 1 deletion port/action/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
)

var _ resource.Resource = &ActionResource{}
Expand Down
22 changes: 11 additions & 11 deletions port/action/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/port-labs/terraform-provider-port-labs/internal/acctest"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/acctest"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func testAccCreateBlueprintConfig(identifier string) string {
Expand Down Expand Up @@ -76,7 +76,7 @@ func TestAccPortAction(t *testing.T) {
"myStringIdentifier" = {
"title" = "My String Identifier"
"required" = true
}
}
"number_props" = {
Expand Down Expand Up @@ -752,7 +752,7 @@ func TestAccPortActionEnumJqQuery(t *testing.T) {
enum_jq_query = "[1, 2]"
}
}
}
}
}
Expand Down Expand Up @@ -1212,7 +1212,7 @@ func TestAccPortActionRequiredConflictsWithRequiredJQ(t *testing.T) {
self_service_trigger = {
operation = "DAY-2"
blueprint_identifier = port_blueprint.microservice.identifier
user_properties = {
user_properties = {
"string_props" = {
"equalsOne" = {
"title" = "equalsOne"
Expand Down Expand Up @@ -1313,13 +1313,13 @@ func TestAccPortActionRequiredFalseAndNull(t *testing.T) {
self_service_trigger = {
operation = "DAY-2"
blueprint_identifier = port_blueprint.microservice.identifier
user_properties = {
user_properties = {
"string_props" = {
"notRequiredExist" = {
"title" = "notEqualsOne"
}
"requiredTrue" = {
"title" = "notEqualsOne"
"title" = "notEqualsOne"
"required" = true
}
}
Expand Down Expand Up @@ -1684,25 +1684,25 @@ func TestAccPortActionNoUserPropertiesConditional(t *testing.T) {
title = "Prop"
}
} : null
number_props = port_blueprint.microservice.identifier == "notTheRealIdentifier" ? {
numProp = {
title = "Prop"
}
} : null
boolean_props = port_blueprint.microservice.identifier == "notTheRealIdentifier" ? {
boolProp = {
title = "Prop"
}
} : null
object_props = port_blueprint.microservice.identifier == "notTheRealIdentifier" ? {
objProp = {
title = "Prop"
}
} : null
array_props = port_blueprint.microservice.identifier == "notTheRealIdentifier" ? {
arrProp = {
title = "Prop"
Expand Down
2 changes: 1 addition & 1 deletion port/action/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-go/tftypes"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
"regexp"
)

Expand Down
6 changes: 3 additions & 3 deletions port/action/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/flex"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func stringPropResourceToBody(ctx context.Context, d *SelfServiceTriggerModel, props map[string]cli.ActionProperty, required *[]string) error {
Expand Down
4 changes: 2 additions & 2 deletions port/aggregation-properties/readStateToPortBody.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package aggregation_properties

import (
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func aggregationPropertiesToBody(state *AggregationPropertiesModel) (*map[string]cli.BlueprintAggregationProperty, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package aggregation_properties

import (
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/internal/utils"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils"
)

func refreshAggregationPropertiesState(state *AggregationPropertiesModel, aggregationProperties map[string]cli.BlueprintAggregationProperty) error {
Expand Down
2 changes: 1 addition & 1 deletion port/aggregation-properties/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/port-labs/terraform-provider-port-labs/internal/cli"
"github.com/port-labs/terraform-provider-port-labs/v2/internal/cli"
)

var _ resource.Resource = &AggregationPropertiesResource{}
Expand Down
Loading

0 comments on commit 77c940a

Please sign in to comment.