-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3236 from terraform-providers/f-data-factory-dataset
New Resource: `azurerm_data_factory_dataset_sql_server_table`
- Loading branch information
Showing
9 changed files
with
806 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package azurerm | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" | ||
) | ||
|
||
func expandDataFactoryParameters(input map[string]interface{}) map[string]*datafactory.ParameterSpecification { | ||
output := make(map[string]*datafactory.ParameterSpecification) | ||
|
||
for k, v := range input { | ||
output[k] = &datafactory.ParameterSpecification{ | ||
Type: datafactory.ParameterTypeString, | ||
DefaultValue: v.(string), | ||
} | ||
} | ||
|
||
return output | ||
} | ||
|
||
func flattenDataFactoryParameters(input map[string]*datafactory.ParameterSpecification) map[string]interface{} { | ||
output := make(map[string]interface{}) | ||
|
||
for k, v := range input { | ||
if v != nil { | ||
// we only support string parameters at this time | ||
val, ok := v.DefaultValue.(string) | ||
if !ok { | ||
log.Printf("[DEBUG] Skipping parameter %q since it's not a string", k) | ||
} | ||
|
||
output[k] = val | ||
} | ||
} | ||
|
||
return output | ||
} | ||
|
||
func flattenDataFactoryAnnotations(input *[]interface{}) []string { | ||
annotations := make([]string, 0) | ||
if input == nil { | ||
return annotations | ||
} | ||
|
||
for _, annotation := range *input { | ||
val, ok := annotation.(string) | ||
if !ok { | ||
log.Printf("[DEBUG] Skipping annotation %q since it's not a string", val) | ||
} | ||
annotations = append(annotations, val) | ||
} | ||
return annotations | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.