-
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 #9057 from terraform-providers/r/virtual-desktop
r/virtual_desktop_workspace_application_group_association: fixing import support
- Loading branch information
Showing
27 changed files
with
636 additions
and
462 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,43 @@ | ||
package parse | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" | ||
) | ||
|
||
type DataShareAccountId struct { | ||
ResourceGroup string | ||
Name string | ||
} | ||
|
||
func (id DataShareAccountId) ID(subscriptionId string) string { | ||
fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DataShare/accounts/%s" | ||
return fmt.Sprintf(fmtString, subscriptionId, id.ResourceGroup, id.Name) | ||
} | ||
|
||
func NewDataShareAccountId(resourceGroup, name string) DataShareAccountId { | ||
return DataShareAccountId{ | ||
ResourceGroup: resourceGroup, | ||
Name: name, | ||
} | ||
} | ||
|
||
func DataShareAccountID(input string) (*DataShareAccountId, error) { | ||
id, err := azure.ParseAzureResourceID(input) | ||
if err != nil { | ||
return nil, fmt.Errorf("parsing DataShareAccount ID %q: %+v", input, err) | ||
} | ||
|
||
dataShareAccount := DataShareAccountId{ | ||
ResourceGroup: id.ResourceGroup, | ||
} | ||
if dataShareAccount.Name, err = id.PopSegment("accounts"); err != nil { | ||
return nil, err | ||
} | ||
if err := id.ValidateNoEmptySegments(input); err != nil { | ||
return nil, err | ||
} | ||
|
||
return &dataShareAccount, nil | ||
} |
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,39 @@ | ||
package parse | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" | ||
) | ||
|
||
type DataShareDataSetId struct { | ||
ResourceGroup string | ||
AccountName string | ||
ShareName string | ||
Name string | ||
} | ||
|
||
func DataShareDataSetID(input string) (*DataShareDataSetId, error) { | ||
id, err := azure.ParseAzureResourceID(input) | ||
if err != nil { | ||
return nil, fmt.Errorf("[ERROR] Unable to parse DataShareDataSet ID %q: %+v", input, err) | ||
} | ||
|
||
dataShareDataSet := DataShareDataSetId{ | ||
ResourceGroup: id.ResourceGroup, | ||
} | ||
if dataShareDataSet.AccountName, err = id.PopSegment("accounts"); err != nil { | ||
return nil, err | ||
} | ||
if dataShareDataSet.ShareName, err = id.PopSegment("shares"); err != nil { | ||
return nil, err | ||
} | ||
if dataShareDataSet.Name, err = id.PopSegment("dataSets"); err != nil { | ||
return nil, err | ||
} | ||
if err := id.ValidateNoEmptySegments(input); err != nil { | ||
return nil, err | ||
} | ||
|
||
return &dataShareDataSet, nil | ||
} |
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.