Skip to content

Commit 2170cd3

Browse files
Merge pull request hashicorp#14154 from hashicorp/pandora-powerbi-regen
powerbi - regenerate embedded sdk
2 parents ae96dd4 + 6907fe0 commit 2170cd3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2623
-524
lines changed

internal/services/powerbi/powerbi_embedded_resource.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ func resourcePowerBIEmbeddedRead(d *pluginsdk.ResourceData, meta interface{}) er
150150
return fmt.Errorf("retrieving %s: %+v", *id, err)
151151
}
152152

153-
d.Set("name", id.CapacityName)
154-
d.Set("resource_group_name", id.ResourceGroup)
153+
d.Set("name", id.DedicatedCapacityName)
154+
d.Set("resource_group_name", id.ResourceGroupName)
155155

156156
if model := resp.Model; model != nil {
157157
d.Set("location", location.Normalize(model.Location))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package autoscalevcores
2+
3+
import "github.com/Azure/go-autorest/autorest"
4+
5+
type AutoScaleVCoresClient struct {
6+
Client autorest.Client
7+
baseUri string
8+
}
9+
10+
func NewAutoScaleVCoresClientWithBaseURI(endpoint string) AutoScaleVCoresClient {
11+
return AutoScaleVCoresClient{
12+
Client: autorest.NewClientWithUserAgent(userAgent()),
13+
baseUri: endpoint,
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
package autoscalevcores
2+
3+
import "strings"
4+
5+
type IdentityType string
6+
7+
const (
8+
IdentityTypeApplication IdentityType = "Application"
9+
IdentityTypeKey IdentityType = "Key"
10+
IdentityTypeManagedIdentity IdentityType = "ManagedIdentity"
11+
IdentityTypeUser IdentityType = "User"
12+
)
13+
14+
func PossibleValuesForIdentityType() []string {
15+
return []string{
16+
string(IdentityTypeApplication),
17+
string(IdentityTypeKey),
18+
string(IdentityTypeManagedIdentity),
19+
string(IdentityTypeUser),
20+
}
21+
}
22+
23+
func parseIdentityType(input string) (*IdentityType, error) {
24+
vals := map[string]IdentityType{
25+
"application": IdentityTypeApplication,
26+
"key": IdentityTypeKey,
27+
"managedidentity": IdentityTypeManagedIdentity,
28+
"user": IdentityTypeUser,
29+
}
30+
if v, ok := vals[strings.ToLower(input)]; ok {
31+
return &v, nil
32+
}
33+
34+
// otherwise presume it's an undefined value and best-effort it
35+
out := IdentityType(input)
36+
return &out, nil
37+
}
38+
39+
type VCoreProvisioningState string
40+
41+
const (
42+
VCoreProvisioningStateSucceeded VCoreProvisioningState = "Succeeded"
43+
)
44+
45+
func PossibleValuesForVCoreProvisioningState() []string {
46+
return []string{
47+
string(VCoreProvisioningStateSucceeded),
48+
}
49+
}
50+
51+
func parseVCoreProvisioningState(input string) (*VCoreProvisioningState, error) {
52+
vals := map[string]VCoreProvisioningState{
53+
"succeeded": VCoreProvisioningStateSucceeded,
54+
}
55+
if v, ok := vals[strings.ToLower(input)]; ok {
56+
return &v, nil
57+
}
58+
59+
// otherwise presume it's an undefined value and best-effort it
60+
out := VCoreProvisioningState(input)
61+
return &out, nil
62+
}
63+
64+
type VCoreSkuTier string
65+
66+
const (
67+
VCoreSkuTierAutoScale VCoreSkuTier = "AutoScale"
68+
)
69+
70+
func PossibleValuesForVCoreSkuTier() []string {
71+
return []string{
72+
string(VCoreSkuTierAutoScale),
73+
}
74+
}
75+
76+
func parseVCoreSkuTier(input string) (*VCoreSkuTier, error) {
77+
vals := map[string]VCoreSkuTier{
78+
"autoscale": VCoreSkuTierAutoScale,
79+
}
80+
if v, ok := vals[strings.ToLower(input)]; ok {
81+
return &v, nil
82+
}
83+
84+
// otherwise presume it's an undefined value and best-effort it
85+
out := VCoreSkuTier(input)
86+
return &out, nil
87+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
package autoscalevcores
2+
3+
import (
4+
"fmt"
5+
"strings"
6+
7+
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
8+
)
9+
10+
var _ resourceids.ResourceId = AutoScaleVCoreId{}
11+
12+
// AutoScaleVCoreId is a struct representing the Resource ID for a Auto Scale V Core
13+
type AutoScaleVCoreId struct {
14+
SubscriptionId string
15+
ResourceGroupName string
16+
VcoreName string
17+
}
18+
19+
// NewAutoScaleVCoreID returns a new AutoScaleVCoreId struct
20+
func NewAutoScaleVCoreID(subscriptionId string, resourceGroupName string, vcoreName string) AutoScaleVCoreId {
21+
return AutoScaleVCoreId{
22+
SubscriptionId: subscriptionId,
23+
ResourceGroupName: resourceGroupName,
24+
VcoreName: vcoreName,
25+
}
26+
}
27+
28+
// ParseAutoScaleVCoreID parses 'input' into a AutoScaleVCoreId
29+
func ParseAutoScaleVCoreID(input string) (*AutoScaleVCoreId, error) {
30+
parser := resourceids.NewParserFromResourceIdType(AutoScaleVCoreId{})
31+
parsed, err := parser.Parse(input, false)
32+
if err != nil {
33+
return nil, fmt.Errorf("parsing %q: %+v", input, err)
34+
}
35+
36+
var ok bool
37+
id := AutoScaleVCoreId{}
38+
39+
if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
40+
return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input)
41+
}
42+
43+
if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok {
44+
return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input)
45+
}
46+
47+
if id.VcoreName, ok = parsed.Parsed["vcoreName"]; !ok {
48+
return nil, fmt.Errorf("the segment 'vcoreName' was not found in the resource id %q", input)
49+
}
50+
51+
return &id, nil
52+
}
53+
54+
// ParseAutoScaleVCoreIDInsensitively parses 'input' case-insensitively into a AutoScaleVCoreId
55+
// note: this method should only be used for API response data and not user input
56+
func ParseAutoScaleVCoreIDInsensitively(input string) (*AutoScaleVCoreId, error) {
57+
parser := resourceids.NewParserFromResourceIdType(AutoScaleVCoreId{})
58+
parsed, err := parser.Parse(input, true)
59+
if err != nil {
60+
return nil, fmt.Errorf("parsing %q: %+v", input, err)
61+
}
62+
63+
var ok bool
64+
id := AutoScaleVCoreId{}
65+
66+
if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok {
67+
return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input)
68+
}
69+
70+
if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok {
71+
return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input)
72+
}
73+
74+
if id.VcoreName, ok = parsed.Parsed["vcoreName"]; !ok {
75+
return nil, fmt.Errorf("the segment 'vcoreName' was not found in the resource id %q", input)
76+
}
77+
78+
return &id, nil
79+
}
80+
81+
// ValidateAutoScaleVCoreID checks that 'input' can be parsed as a Auto Scale V Core ID
82+
func ValidateAutoScaleVCoreID(input interface{}, key string) (warnings []string, errors []error) {
83+
v, ok := input.(string)
84+
if !ok {
85+
errors = append(errors, fmt.Errorf("expected %q to be a string", key))
86+
return
87+
}
88+
89+
if _, err := ParseAutoScaleVCoreID(v); err != nil {
90+
errors = append(errors, err)
91+
}
92+
93+
return
94+
}
95+
96+
// ID returns the formatted Auto Scale V Core ID
97+
func (id AutoScaleVCoreId) ID() string {
98+
fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.PowerBIDedicated/autoScaleVCores/%s"
99+
return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VcoreName)
100+
}
101+
102+
// Segments returns a slice of Resource ID Segments which comprise this Auto Scale V Core ID
103+
func (id AutoScaleVCoreId) Segments() []resourceids.Segment {
104+
return []resourceids.Segment{
105+
resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"),
106+
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
107+
resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"),
108+
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"),
109+
resourceids.StaticSegment("providers", "providers", "providers"),
110+
resourceids.ResourceProviderSegment("microsoftPowerBIDedicated", "Microsoft.PowerBIDedicated", "Microsoft.PowerBIDedicated"),
111+
resourceids.StaticSegment("autoScaleVCores", "autoScaleVCores", "autoScaleVCores"),
112+
resourceids.UserSpecifiedSegment("vcoreName", "vcoreValue"),
113+
}
114+
}
115+
116+
// String returns a human-readable description of this Auto Scale V Core ID
117+
func (id AutoScaleVCoreId) String() string {
118+
components := []string{
119+
fmt.Sprintf("Subscription: %q", id.SubscriptionId),
120+
fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName),
121+
fmt.Sprintf("Vcore Name: %q", id.VcoreName),
122+
}
123+
return fmt.Sprintf("Auto Scale V Core (%s)", strings.Join(components, "\n"))
124+
}

0 commit comments

Comments
 (0)