forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 0
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 hashicorp#14154 from hashicorp/pandora-powerbi-regen
powerbi - regenerate embedded sdk
- Loading branch information
Showing
41 changed files
with
2,623 additions
and
524 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
15 changes: 15 additions & 0 deletions
15
internal/services/powerbi/sdk/2021-01-01/autoscalevcores/client.go
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,15 @@ | ||
package autoscalevcores | ||
|
||
import "github.com/Azure/go-autorest/autorest" | ||
|
||
type AutoScaleVCoresClient struct { | ||
Client autorest.Client | ||
baseUri string | ||
} | ||
|
||
func NewAutoScaleVCoresClientWithBaseURI(endpoint string) AutoScaleVCoresClient { | ||
return AutoScaleVCoresClient{ | ||
Client: autorest.NewClientWithUserAgent(userAgent()), | ||
baseUri: endpoint, | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
internal/services/powerbi/sdk/2021-01-01/autoscalevcores/constants.go
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,87 @@ | ||
package autoscalevcores | ||
|
||
import "strings" | ||
|
||
type IdentityType string | ||
|
||
const ( | ||
IdentityTypeApplication IdentityType = "Application" | ||
IdentityTypeKey IdentityType = "Key" | ||
IdentityTypeManagedIdentity IdentityType = "ManagedIdentity" | ||
IdentityTypeUser IdentityType = "User" | ||
) | ||
|
||
func PossibleValuesForIdentityType() []string { | ||
return []string{ | ||
string(IdentityTypeApplication), | ||
string(IdentityTypeKey), | ||
string(IdentityTypeManagedIdentity), | ||
string(IdentityTypeUser), | ||
} | ||
} | ||
|
||
func parseIdentityType(input string) (*IdentityType, error) { | ||
vals := map[string]IdentityType{ | ||
"application": IdentityTypeApplication, | ||
"key": IdentityTypeKey, | ||
"managedidentity": IdentityTypeManagedIdentity, | ||
"user": IdentityTypeUser, | ||
} | ||
if v, ok := vals[strings.ToLower(input)]; ok { | ||
return &v, nil | ||
} | ||
|
||
// otherwise presume it's an undefined value and best-effort it | ||
out := IdentityType(input) | ||
return &out, nil | ||
} | ||
|
||
type VCoreProvisioningState string | ||
|
||
const ( | ||
VCoreProvisioningStateSucceeded VCoreProvisioningState = "Succeeded" | ||
) | ||
|
||
func PossibleValuesForVCoreProvisioningState() []string { | ||
return []string{ | ||
string(VCoreProvisioningStateSucceeded), | ||
} | ||
} | ||
|
||
func parseVCoreProvisioningState(input string) (*VCoreProvisioningState, error) { | ||
vals := map[string]VCoreProvisioningState{ | ||
"succeeded": VCoreProvisioningStateSucceeded, | ||
} | ||
if v, ok := vals[strings.ToLower(input)]; ok { | ||
return &v, nil | ||
} | ||
|
||
// otherwise presume it's an undefined value and best-effort it | ||
out := VCoreProvisioningState(input) | ||
return &out, nil | ||
} | ||
|
||
type VCoreSkuTier string | ||
|
||
const ( | ||
VCoreSkuTierAutoScale VCoreSkuTier = "AutoScale" | ||
) | ||
|
||
func PossibleValuesForVCoreSkuTier() []string { | ||
return []string{ | ||
string(VCoreSkuTierAutoScale), | ||
} | ||
} | ||
|
||
func parseVCoreSkuTier(input string) (*VCoreSkuTier, error) { | ||
vals := map[string]VCoreSkuTier{ | ||
"autoscale": VCoreSkuTierAutoScale, | ||
} | ||
if v, ok := vals[strings.ToLower(input)]; ok { | ||
return &v, nil | ||
} | ||
|
||
// otherwise presume it's an undefined value and best-effort it | ||
out := VCoreSkuTier(input) | ||
return &out, nil | ||
} |
124 changes: 124 additions & 0 deletions
124
internal/services/powerbi/sdk/2021-01-01/autoscalevcores/id_autoscalevcore.go
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,124 @@ | ||
package autoscalevcores | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" | ||
) | ||
|
||
var _ resourceids.ResourceId = AutoScaleVCoreId{} | ||
|
||
// AutoScaleVCoreId is a struct representing the Resource ID for a Auto Scale V Core | ||
type AutoScaleVCoreId struct { | ||
SubscriptionId string | ||
ResourceGroupName string | ||
VcoreName string | ||
} | ||
|
||
// NewAutoScaleVCoreID returns a new AutoScaleVCoreId struct | ||
func NewAutoScaleVCoreID(subscriptionId string, resourceGroupName string, vcoreName string) AutoScaleVCoreId { | ||
return AutoScaleVCoreId{ | ||
SubscriptionId: subscriptionId, | ||
ResourceGroupName: resourceGroupName, | ||
VcoreName: vcoreName, | ||
} | ||
} | ||
|
||
// ParseAutoScaleVCoreID parses 'input' into a AutoScaleVCoreId | ||
func ParseAutoScaleVCoreID(input string) (*AutoScaleVCoreId, error) { | ||
parser := resourceids.NewParserFromResourceIdType(AutoScaleVCoreId{}) | ||
parsed, err := parser.Parse(input, false) | ||
if err != nil { | ||
return nil, fmt.Errorf("parsing %q: %+v", input, err) | ||
} | ||
|
||
var ok bool | ||
id := AutoScaleVCoreId{} | ||
|
||
if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { | ||
return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) | ||
} | ||
|
||
if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { | ||
return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) | ||
} | ||
|
||
if id.VcoreName, ok = parsed.Parsed["vcoreName"]; !ok { | ||
return nil, fmt.Errorf("the segment 'vcoreName' was not found in the resource id %q", input) | ||
} | ||
|
||
return &id, nil | ||
} | ||
|
||
// ParseAutoScaleVCoreIDInsensitively parses 'input' case-insensitively into a AutoScaleVCoreId | ||
// note: this method should only be used for API response data and not user input | ||
func ParseAutoScaleVCoreIDInsensitively(input string) (*AutoScaleVCoreId, error) { | ||
parser := resourceids.NewParserFromResourceIdType(AutoScaleVCoreId{}) | ||
parsed, err := parser.Parse(input, true) | ||
if err != nil { | ||
return nil, fmt.Errorf("parsing %q: %+v", input, err) | ||
} | ||
|
||
var ok bool | ||
id := AutoScaleVCoreId{} | ||
|
||
if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { | ||
return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) | ||
} | ||
|
||
if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { | ||
return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) | ||
} | ||
|
||
if id.VcoreName, ok = parsed.Parsed["vcoreName"]; !ok { | ||
return nil, fmt.Errorf("the segment 'vcoreName' was not found in the resource id %q", input) | ||
} | ||
|
||
return &id, nil | ||
} | ||
|
||
// ValidateAutoScaleVCoreID checks that 'input' can be parsed as a Auto Scale V Core ID | ||
func ValidateAutoScaleVCoreID(input interface{}, key string) (warnings []string, errors []error) { | ||
v, ok := input.(string) | ||
if !ok { | ||
errors = append(errors, fmt.Errorf("expected %q to be a string", key)) | ||
return | ||
} | ||
|
||
if _, err := ParseAutoScaleVCoreID(v); err != nil { | ||
errors = append(errors, err) | ||
} | ||
|
||
return | ||
} | ||
|
||
// ID returns the formatted Auto Scale V Core ID | ||
func (id AutoScaleVCoreId) ID() string { | ||
fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.PowerBIDedicated/autoScaleVCores/%s" | ||
return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VcoreName) | ||
} | ||
|
||
// Segments returns a slice of Resource ID Segments which comprise this Auto Scale V Core ID | ||
func (id AutoScaleVCoreId) Segments() []resourceids.Segment { | ||
return []resourceids.Segment{ | ||
resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"), | ||
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), | ||
resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"), | ||
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), | ||
resourceids.StaticSegment("providers", "providers", "providers"), | ||
resourceids.ResourceProviderSegment("microsoftPowerBIDedicated", "Microsoft.PowerBIDedicated", "Microsoft.PowerBIDedicated"), | ||
resourceids.StaticSegment("autoScaleVCores", "autoScaleVCores", "autoScaleVCores"), | ||
resourceids.UserSpecifiedSegment("vcoreName", "vcoreValue"), | ||
} | ||
} | ||
|
||
// String returns a human-readable description of this Auto Scale V Core ID | ||
func (id AutoScaleVCoreId) String() string { | ||
components := []string{ | ||
fmt.Sprintf("Subscription: %q", id.SubscriptionId), | ||
fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), | ||
fmt.Sprintf("Vcore Name: %q", id.VcoreName), | ||
} | ||
return fmt.Sprintf("Auto Scale V Core (%s)", strings.Join(components, "\n")) | ||
} |
Oops, something went wrong.