Skip to content

Commit

Permalink
Addressing PR feedbacks - iteration 2
Browse files Browse the repository at this point in the history
- Switch to go-azure-sdk
- Add nil checks, remove additional_properties from acctest
- Document the limited support of string parameters
- Renamed resource go type to be consistent with file name
  • Loading branch information
gerrytan committed Dec 13, 2024
1 parent f65b76f commit d95a18f
Show file tree
Hide file tree
Showing 232 changed files with 11,589 additions and 405 deletions.
9 changes: 9 additions & 0 deletions internal/services/datafactory/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/credentials"
"github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/datasets"
"github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/factories"
"github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/managedprivateendpoints"
"github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/managedvirtualnetworks"
Expand All @@ -17,6 +18,7 @@ import (
type Client struct {
Factories *factories.FactoriesClient
Credentials *credentials.CredentialsClient
DatasetClientGoAzureSDK *datasets.DatasetsClient
ManagedPrivateEndpoints *managedprivateendpoints.ManagedPrivateEndpointsClient
ManagedVirtualNetworks *managedvirtualnetworks.ManagedVirtualNetworksClient

Expand All @@ -42,6 +44,12 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
}
o.Configure(credentialsClient.Client, o.Authorizers.ResourceManager)

datasetClientGoAzureSDK, err := datasets.NewDatasetsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Datasets client: %+v", err)
}
o.Configure(datasetClientGoAzureSDK.Client, o.Authorizers.ResourceManager)

managedPrivateEndpointsClient, err := managedprivateendpoints.NewManagedPrivateEndpointsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building ManagedPrivateEndpoints client: %+v", err)
Expand Down Expand Up @@ -76,6 +84,7 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
return &Client{
Factories: factoriesClient,
Credentials: credentialsClient,
DatasetClientGoAzureSDK: datasetClientGoAzureSDK,
ManagedPrivateEndpoints: managedPrivateEndpointsClient,
ManagedVirtualNetworks: managedVirtualNetworksClient,

Expand Down
30 changes: 0 additions & 30 deletions internal/services/datafactory/data_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,36 +144,6 @@ func flattenDataFactoryVariables(input map[string]*datafactory.VariableSpecifica
return output
}

func expandAdditionalProperties(input *map[string]string) map[string]interface{} {
if input == nil {
return nil
}

output := make(map[string]interface{})
for k, v := range *input {
output[k] = v
}

return output
}

func flattenAdditionalProperties(input *map[string]interface{}) map[string]string {
if input == nil {
return nil
}

output := make(map[string]string)
for k, v := range *input {
if strVal, ok := v.(string); ok {
output[k] = strVal
} else {
log.Printf("[DEBUG] Skipping property %q since it's not a string", k)
}
}

return output
}

// DatasetColumn describes the attributes needed to specify a structure column for a dataset
type DatasetColumn struct {
Name string `json:"name,omitempty" tfschema:"name"`
Expand Down
Loading

0 comments on commit d95a18f

Please sign in to comment.