-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
New Resource: azurerm_data_factory_dataset_sql_server_table
#3236
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cc26951
Start of datasets
mbfrahry 52abfb6
Changing the name
mbfrahry 77d87da
Merge branch 'master' into f-data-factory-dataset
mbfrahry c97bf11
Start of tests
mbfrahry d5c9a69
Merge with master
mbfrahry af776c6
Finalizing dataset sql server table
mbfrahry feba3d5
Addressing kt's comments
mbfrahry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could use
utils.FlattenStringArray
instead of this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weirdly enough, I think it'd be a call to utils.ExpandStringArray
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought. I think it's needed because it's an *[]interface{} and we'd need to do some finagling to get it to a []string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh yea sorry, its so close to the signature, and as much as i'd want to ask if terraform would accept the interface array i know we should check they are all strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries!